解析器不一致,导致ts的某些特性不能使用,真坑

This commit is contained in:
xuyanfeng 2021-04-03 20:27:39 +08:00
parent a30e435f00
commit b928d14688
6 changed files with 39 additions and 21 deletions

View File

@ -144,21 +144,16 @@
<script lang="ts"> <script lang="ts">
import Vue from "vue" import Vue from "vue"
import {Component, Prop, Emit} from "vue-property-decorator" import {Component, Prop, Emit} from "vue-property-decorator"
import {} from 'vue-class-component'
import UiProp from './ui-prop.vue' import UiProp from './ui-prop.vue'
import {setup} from "vue-class-component/dist/vue-class-component";
@Component({ @Component({
components: {UiProp}, components: {UiProp},
}) })
export default class NodeBaseProperty extends Vue { export default class NodeBaseProperty extends Vue {
name: string = "node-base" name: string = "node-base"
label: string = ''
// @Prop({required: false}) @Prop() private data: any = {};
// label: string = ''
//
// @Prop({required: false})
// data: any = {};
setup() { setup() {
// computed({ // computed({
@ -168,6 +163,11 @@ export default class NodeBaseProperty extends Vue {
// }) // })
} }
created() {
console.error(JSON.stringify(this.data))
}
itemData: any = {}; itemData: any = {};
changeSizeActionWidth(step: number) { changeSizeActionWidth(step: number) {

View File

@ -29,9 +29,10 @@
</div> </div>
<div class="right"> <div class="right">
<div class=" bg-purple-light treeInfo"> <div class=" bg-purple-light treeInfo">
<NodeBaseProperty :data="treeItemData"></NodeBaseProperty> <NodeBaseProperty data="treeItemData"></NodeBaseProperty>
<SceneProperty v-show=" treeItemData.type === 'cc_Scene'"></SceneProperty> <SceneProperty v-show="treeItemData.type === 'cc_Scene'"></SceneProperty>
<ComponentsProperty :components.sync="treeItemData.components"></ComponentsProperty> <ComponentsProperty components.sync="treeItemData.components"></ComponentsProperty>
<HelloWorld msg="fsfsfsfsffdqwe"></HelloWorld>
</div> </div>
</div> </div>
@ -51,28 +52,35 @@ import Vue from "vue";
import NodeBaseProperty from './ccType/NodeBaseProperty' import NodeBaseProperty from './ccType/NodeBaseProperty'
import ComponentsProperty from './ccType/ComponentsProperty' import ComponentsProperty from './ccType/ComponentsProperty'
import SceneProperty from './ccType/SceneProperty' import SceneProperty from './ccType/SceneProperty'
import {Component} from "vue-property-decorator"; import {Component, Prop} from "vue-property-decorator";
import tree from "element-ui/packages/table/src/store/tree";
import fa from "element-ui/src/locale/lang/fa";
import HelloWorld from "@/popup/HelloWorld.vue";
const PluginMsg = require("../core/plugin-msg"); const PluginMsg = require("../core/plugin-msg");
@Component({components: {NodeBaseProperty, ComponentsProperty, SceneProperty}}) @Component({
components: {
NodeBaseProperty, ComponentsProperty, SceneProperty, HelloWorld
}
})
export default class Index extends Vue { export default class Index extends Vue {
isShowDebug: boolean = true; private isShowDebug: boolean = true;
treeItemData: Object = {}; treeItemData = {a: 1};
treeData = [] treeData = []
treeDataMap = {};
bgConn = null// background.js bgConn = null// background.js
// el-treekey
defaultProps = { defaultProps = {
children: "children", children: "children",
label: "name" label: "name"
}; };
watchEveryTime: boolean = false;// private watchEveryTime: boolean = false;//
memory = { memory = {
performance: {}, performance: {},
console: {}, console: {},
} }
created() { created() {
this.onTestData(); this.onTestData();
if (chrome && chrome.runtime) { if (chrome && chrome.runtime) {

View File

@ -1,12 +1,16 @@
<template> <template>
<div>
<el-button @click="onClickTest">1111</el-button> <el-button @click="onClickTest">1111</el-button>
<HelloWorld msg="fsf"></HelloWorld>
</div>
</template> </template>
<script lang="ts"> <script lang="ts">
import {Component, Vue} from "vue-property-decorator"; import {Component, Vue} from "vue-property-decorator";
import HelloWorld from "@/popup/HelloWorld.vue";
@Component({ @Component({
components: {}, components: {HelloWorld},
}) })
export default class Index extends Vue { export default class Index extends Vue {
name: string = "index"; name: string = "index";

View File

@ -9,6 +9,13 @@ import {Component, Prop, Vue} from "vue-property-decorator";
@Component @Component
export default class HelloWorld extends Vue { export default class HelloWorld extends Vue {
@Prop()
msg = ''
created() {
debugger
console.log(this.msg)
}
} }
</script> </script>

View File

@ -35,6 +35,7 @@
</a> </a>
</div> </div>
</div> </div>
<HelloWorld msg="fsfsf"></HelloWorld>
</div> </div>
</template> </template>

View File

@ -1,5 +1,3 @@
const ChromeManifest = require("./plugins/chrome-manifest");
const Path = require("path");
module.exports = { module.exports = {
publicPath: "/", publicPath: "/",
outputDir: "dist", outputDir: "dist",