1234567891011121314151617181920212223242526272829303132333435363738 |
- <div id="{$name}">
- <input type="hidden" name="{$name}" value="">
- <el-cascader
- v-model="value"
- :options="options"
- :props="props"
- collapse-tags
- clearable
- style="width:100%"
- ></el-cascader>
- </div>
- <script>
- new Vue({
- el: '#{$name}',
- data: function() {
- return {
- props: { multiple: true },
- // props:{
- // value: 'id',
- // label: 'title',
- // children: 'child'
- // },
- options: {:json_encode($lists)},
- value: {:json_encode($val)}
- }
- },
- watch: {
- value: function (newVal, oldVal) {
- $('input[name={$name}]').val(newVal.join(','));
- }
- },
- created(){
- const vals = this.value;
- $('input[name={$name}]').val(vals.join(','));
- }
- })
- </script>
|