javascript - How to declare Vue data type - Stack Overflow

I would like to assign a datatype to data variable.var app = new Vue({el: '#app',data: {var1:

I would like to assign a datatype to data variable.

var app = new Vue({
  el: '#app',
  data: {
      var1:'',

  },
  methods:{

  },

  delimiters: ["[[","]]"],
});

How can I assign a datatype = Integer to var1.

I would like to assign a datatype to data variable.

var app = new Vue({
  el: '#app',
  data: {
      var1:'',

  },
  methods:{

  },

  delimiters: ["[[","]]"],
});

How can I assign a datatype = Integer to var1.

Share asked Dec 19, 2018 at 8:57 AseemAseem 6,8178 gold badges55 silver badges95 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 2

Basically, you don't. You could of course, use TypeScript for that but in plain javascript it's not made for this.

Vue's api documentation explains this pretty clearly.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744924097a4601321.html

相关推荐

  • javascript - How to declare Vue data type - Stack Overflow

    I would like to assign a datatype to data variable.var app = new Vue({el: '#app',data: {var1:

    1天前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信