在Vue中,可以使用const关键字来定义一个数组,如下所示:

<script>
export default {
  data() {
    return {
      list: const []
    }
  }
}
</script>

在上述代码中,使用const关键字来定义了一个名为list的数组,并将其赋值为空数组。

vue用const定义数组怎么写const list = ;不要用export default !!!不要写export default !!!

原文地址: https://www.cveoy.top/t/topic/i6cq 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录