1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
| import { defineComponent, ref } from "vue";
|
| export default defineComponent({
| name: "test2",
|
| props: {
| modelValue: String,
| scope: null
| },
|
| emits: ["update:modelValue", "change"],
|
| setup(props, { emit }) {
| const value = ref<string>(props.modelValue || "");
|
| function onChange(val: string) {
| emit("update:modelValue", val);
| emit("change", val);
| }
|
| return {
| value,
| onChange
| };
| },
|
| render(ctx: any) {
| return <el-input v-model={ctx.value} size="mini" onChange={ctx.onChange} />;
| }
| });
|
|