所以我用vuetify与VUE-CLI,这是我的电流分量代码:如何将指令绑定到VueJS中的自定义组件?
<template>
<div>
<v-row>
<v-col xl3 md3 xs12>
<strong>{{field}}</strong>
</v-col>
<v-col xl9 md9 xs12>
{{value}}
</v-col>
</v-row>
</div>
</template>
<script>
export default {
data() {
return {
}
},
props: ['field', 'value']
}
</script>
,我使用它在我的模板,这样
<template>
<two-column field="Some Field" value="Some Value"></two-column>
</template>
<script>
import TwoColumnRow from './vuetify_modifications/TwoColumnRow'
...
</script>
现在一切都完美地工作,但如果我想使网格大小动态?例如像我喜欢的东西
<two-column field="Some Field" value="Some Value" sizes="xl3 md3 xs12"></two-column>
做这可能吗?先谢谢你。
请你放的jsfiddle你的榜样 –