12345678910111213141516171819202122232425262728 |
- <div id="{$name}">
- <input type="hidden" name="{$name}" v-model="value">
- <el-select clearable filterable v-model="value" placeholder="请选择" size="small" style="width: 100%">
- <el-option
- v-for="item in options"
- :key="item.id"
- :label="item.title"
- :value="item.id.toString()">
- </el-option>
- </el-select>
- </div>
- <script>
- new Vue({
- el: '#{$name}',
- data: function() {
- return {
- options: {:json_encode($lists)},
- value:"{$value==0?'':$value}"
- }
- },
- watch: {
- value: function (newVal, oldVal) {
- $('input[name={$name}').val(newVal);
- }
- }
- })
- </script>
|