我是Vue生态系统的新手,我正试图在一个测试项目中获得干净的eslint-plugin-vue结果。在下面的测试Home.vue文件中,我得到了一个警告:The "HelloWorld" component has been used but not registered (vue/no-unregistered-components)。有什么语法上正确的方法来清理这件事?
这是否是 ESLint规则本身的一个限制,即它不承认export default class Home extends Vue {}和@Component(...)语法?
<template>
我有一个Vue/TypeScript类,它调用另一个Vue/TypeScript类上的公共方法。它可以编译并在tsc或WebPack上运行良好。但是当使用rollup和rollup-plugin-vue进行编译时,我得到一个错误,即Property 'close' does not exist on type 'Vue'. 转载链接:https://repl.it/@orobert91/PropertyDoesNotExistOnTypeVue Popover.vue: import { Component } from "vue-property-d
我试着改编,但是遇到了第一个障碍。Property 'created' does not exist on type 'VueConstructor<Vue>'。
下面是我的测试,只是为了验证我的组件确实有一个created钩子:
import {assert} from 'chai';
import MyComponent from '../src/components/MyComponent.vue';
it('has a created hook', function() {
asser
我尝试使用vue-injector,但它使用我的Vue (2.6.10)和Typescript (3.4.5)版本编译。 我几乎看不到其他选择。 在纯粹的typescript方面,我看到了像Inversify和TSyringe这样的东西,它们看起来很好,但不能开箱即用。 这是inversify: Argument of type typeof App' is not assignable to parameter of type 'VueClass<Vue>'.
Type 'typeof App' is not assignab
我最近开始在typescript中使用vue类组件,但是找不到用导入的实用方法来修饰组件类的方法。我正在使用nuxt-property-decorator来装饰我的组件。 我试着添加方法,就像在没有typescript的vue组件中一样: import doSomething from './somewhere';
<script>
export default {
methods: {
doSomething,// I'd do this without typescript, works as expe
我在互联网上发现了很多关于这方面的问题,堆栈溢出,然而,问题似乎总是与反应有关?然而,就像这个一样,我使用的是Vue,错误发生在Vue自己的组件上,这些组件是我为测试类型而做的新安装项目的一部分,通常是类型提示。
错误:
src/App.vue:3:6 - error TS2604: JSX element type 'RouterLink' does not have any construct or call signatures.
3 <router-link to="/sales-running">Sales Running<
我一直试图将Vue.js与TypeScript结合使用,并偶然遇到了。
在这里,我遇到了一些问题,在从TypeScript导入Vue单组件文件时遇到了错误。我正在使用代码。请参阅下面的错误。
main.ts:
// The Vue build version to load with the 'import' command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import * as Vue from 'vue'
import App f
在运行使用Nuxt.js开发的Nuxt.js时,我遇到了一个非常奇怪的错误,它有Vue.js组件。也就是说,在运行应用程序时,我看到了与TypeScript相关的错误,比如TS2749: 'About' refers to a value, but is being used as a type here. Did you mean 'typeof About'?,尽管npm run test没有显示任何内容。
我的带有抱怨行的spec.ts文件
import { shallowMount, Wrapper } from "@vue/test-utils
对以下问题的任何帮助都将不胜感激!
情况:
我的包含两个包
child-component-lib
- contains a single view `About.vue` written in composition-API-style (with vue2 helper libraries `@vue/composition-api` and `vuex-composition-helpers`)
- exports a single `RouteConfig`
- build as a lib
views/About.vue (儿童)
这是一个关于页面(作为组件库)从“@vu
我已经从我的Laravel项目url中删除了public。但是现在我的Vue.js坏了。
如果我从src文件中删除public,它不会识别出项目有Vue.js,但如果我添加public,它就会识别出这个项目有Vue.js。但是它没有在我的Blade页面上显示该组件,而是给出了这个错误:
[Vue warn]: Unknown custom element: <app-some> - did you register the component correctly? For recursive components, make sure to provide the "nam