vue-mixin

ts2339 error: how to use typescript mixin in vuejs project?

与世无争的帅哥 提交于 2020-02-06 19:37:22
问题 i recently converted my vuejs to typescript base, but now i have problem with using mixin in typescript. i used two types of mixin, but none worked for me and it shows error ts2339, and i couldnt found the solution on https://vuejs.org/v2/guide/typescript.html#Basic-Usage: first one: //mixin.ts import {ViewState} from "@/types"; import {mocked_view_state} from "@/api/mock/profile.device.group.mock"; export const ProfileDeviceGroup = { methods: { resetViewState(): ViewState { return mocked

unable to use Mixins in vue with typescript

大兔子大兔子 提交于 2019-12-22 04:36:19
问题 I have a folder structure like this --Page -group.vue --Services -groupMixin.ts script of group.vue <script lang="ts"> import { Vue, Component, Mixins } from 'vue-property-decorator' import { GroupMixin } from '../../services/groupMixin'; @Component export default class Group extends Mixins(GroupMixin) { created () { console.log(this.test) } } </script> code of groupMixin.ts import { Vue } from 'vue-property-decorator' //creating mixins. export class GroupMixin extends Vue { test: string =

unable to use Mixins in vue with typescript

南笙酒味 提交于 2019-12-05 07:18:40
I have a folder structure like this --Page -group.vue --Services -groupMixin.ts script of group.vue <script lang="ts"> import { Vue, Component, Mixins } from 'vue-property-decorator' import { GroupMixin } from '../../services/groupMixin'; @Component export default class Group extends Mixins(GroupMixin) { created () { console.log(this.test) } } </script> code of groupMixin.ts import { Vue } from 'vue-property-decorator' //creating mixins. export class GroupMixin extends Vue { test: string = 'sss' } I am facing two problems here. First, to import a ts file i used ../../, is there any way to use