vue-class-components

is vuejs2.x composition api fully compatibile with typescript?

一世执手 提交于 2021-01-28 06:15:01
问题 Recently i migrated our vue.js2.x project to typescript, and based on evan-you's comment in this issue: https://github.com/vuejs/rfcs/pull/17#issuecomment-494242121 The Class API proposal is being dropped. so i'm using regular option based version of vue.js which it faced me with alot of type problems. I want to know is vuejs2.x composition api fully compatibile with typescript? and should i use it to solve all the problem? what is the best practice to do here in this situation? 回答1: I'm

what will happen for vuejs projects based on class components in vuejs v3.0?

落爺英雄遲暮 提交于 2020-08-07 05:55:41
问题 i wanna upgrade my vuejs project to typescript based on class components, but i read in vue issue's https://github.com/vuejs/rfcs/pull/17#issuecomment-494242121 : Update: the Class API proposal is being dropped. so what will happen to existing class component-based projects? and more important, based on this article: https://alligator.io/vuejs/using-typescript-with-vue/ which says Since we are not using the class-style syntax, you use the as keyword to declare data as a data type. is this way

what will happen for vuejs projects based on class components in vuejs v3.0?

◇◆丶佛笑我妖孽 提交于 2020-08-07 05:54:36
问题 i wanna upgrade my vuejs project to typescript based on class components, but i read in vue issue's https://github.com/vuejs/rfcs/pull/17#issuecomment-494242121 : Update: the Class API proposal is being dropped. so what will happen to existing class component-based projects? and more important, based on this article: https://alligator.io/vuejs/using-typescript-with-vue/ which says Since we are not using the class-style syntax, you use the as keyword to declare data as a data type. is this way

Nuxt async fetch() creating multiple instances? Repeated fetch() calls

让人想犯罪 __ 提交于 2020-07-10 10:26:25
问题 I have a simple BasePreviewImage component that needs to fetch an Array.Buffer() asynchronously from an internal API. However, it appears that async fetch() is called for every instance ever created despite the components themselves being destroyed. Example: <template> <div class="image-container"> </div> </template> <script lang="ts"> import { Vue, Component, Prop } from 'nuxt-property-decorator' @Component({}) export default class BasePreviewImage extends Vue { @Prop({ type: String }) id:

vue-class-component : TS2339 when calling class method

ぐ巨炮叔叔 提交于 2019-12-24 11:27:38
问题 I'm using vue-cli-service to build my vuejs application. The build is successful, but in webstorm IDE, I get some TS2339 errors : Test.vue: <template> <div>{{method()}}</div> </template> <script lang="ts"> import { Component, Vue } from 'vue-property-decorator'; @Component export default class Test extends Vue { public method(): string { return 'hello'; } } </script> Test.spec.ts: import 'jest'; import {mount} from '@vue/test-utils'; import Test from '@/views/common/Test.vue'; describe('Test