This commit is contained in:
darenhsu
2022-07-17 13:16:16 +08:00
parent 84759556ff
commit befd344ab0
28070 changed files with 4008428 additions and 1 deletions
+34
View File
@@ -0,0 +1,34 @@
import Vue from 'vue';
/* @vue/component */
export default Vue.extend({
name: 'roundable',
props: {
rounded: [Boolean, String],
tile: Boolean
},
computed: {
roundedClasses() {
const composite = [];
const rounded = typeof this.rounded === 'string' ? String(this.rounded) : this.rounded === true;
if (this.tile) {
composite.push('rounded-0');
} else if (typeof rounded === 'string') {
const values = rounded.split(' ');
for (const value of values) {
composite.push(`rounded-${value}`);
}
} else if (rounded) {
composite.push('rounded');
}
return composite.length > 0 ? {
[composite.join(' ')]: true
} : {};
}
}
});
//# sourceMappingURL=index.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/mixins/roundable/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAP,MAAgB,KAAhB;AAEA;;AACA,eAAe,GAAG,CAAC,MAAJ,CAAW;AACxB,EAAA,IAAI,EAAE,WADkB;AAGxB,EAAA,KAAK,EAAE;AACL,IAAA,OAAO,EAAE,CAAC,OAAD,EAAU,MAAV,CADJ;AAEL,IAAA,IAAI,EAAE;AAFD,GAHiB;AAQxB,EAAA,QAAQ,EAAE;AACR,IAAA,cAAc,GAAA;AACZ,YAAM,SAAS,GAAG,EAAlB;AACA,YAAM,OAAO,GAAG,OAAO,KAAK,OAAZ,KAAwB,QAAxB,GACZ,MAAM,CAAC,KAAK,OAAN,CADM,GAEZ,KAAK,OAAL,KAAiB,IAFrB;;AAIA,UAAI,KAAK,IAAT,EAAe;AACb,QAAA,SAAS,CAAC,IAAV,CAAe,WAAf;AACD,OAFD,MAEO,IAAI,OAAO,OAAP,KAAmB,QAAvB,EAAiC;AACtC,cAAM,MAAM,GAAG,OAAO,CAAC,KAAR,CAAc,GAAd,CAAf;;AAEA,aAAK,MAAM,KAAX,IAAoB,MAApB,EAA4B;AAC1B,UAAA,SAAS,CAAC,IAAV,CAAe,WAAW,KAAK,EAA/B;AACD;AACF,OANM,MAMA,IAAI,OAAJ,EAAa;AAClB,QAAA,SAAS,CAAC,IAAV,CAAe,SAAf;AACD;;AAED,aAAO,SAAS,CAAC,MAAV,GAAmB,CAAnB,GAAuB;AAC5B,SAAC,SAAS,CAAC,IAAV,CAAe,GAAf,CAAD,GAAuB;AADK,OAAvB,GAEH,EAFJ;AAGD;;AAtBO;AARc,CAAX,CAAf","sourcesContent":["import Vue from 'vue'\n\n/* @vue/component */\nexport default Vue.extend({\n name: 'roundable',\n\n props: {\n rounded: [Boolean, String],\n tile: Boolean,\n },\n\n computed: {\n roundedClasses (): Record<string, boolean> {\n const composite = []\n const rounded = typeof this.rounded === 'string'\n ? String(this.rounded)\n : this.rounded === true\n\n if (this.tile) {\n composite.push('rounded-0')\n } else if (typeof rounded === 'string') {\n const values = rounded.split(' ')\n\n for (const value of values) {\n composite.push(`rounded-${value}`)\n }\n } else if (rounded) {\n composite.push('rounded')\n }\n\n return composite.length > 0 ? {\n [composite.join(' ')]: true,\n } : {}\n },\n },\n})\n"],"sourceRoot":"","file":"index.js"}