1234567891011121314151617181920212223242526272829303132333435 |
- <style>
- </style>
- <div id="{$name}">
- <input type="hidden" name="{$name}" :value="value">
- <el-time-picker
- v-model="value"
- size="small"
- placeholder="选择时间"
- value-format="HH:mm"
- style="width:100%"
- >
- </el-time-picker>
- </div>
- <script>
- new Vue({
- el: '#{$name}',
- data: function() {
- return {
- value: ''
- }
- },
- watch: {
- value: function (newVal, oldVal) {
- $('input[name={$name}]').val(newVal);
- }
- },
- created(){
- const vals = '{$val}';
- if(vals){
- this.value = vals;
- }
- }
- })
- </script>
|