Vue初始化数组数据为空数组

Vue初始化数组数据为空数组

1.初始化为空数组

定义为 ref([] as any[]),我们将其初始化为空数组,并且声明其类型为 any[],即任意类型的数组。

const  fields= ref([] as  any[])

你可能感兴趣的:(Vue,vue.js,前端,javascript)