最近尝试了下typeScript+vue 其中 @Component @props 之类的语法在那里看

javascript typescript xue8 290天前 115次浏览



<script lang="ts">
import Vue from "vue";
import Component from "vue-class-component";
import { State } from "vuex-class";

@Component
export default class Shops extends Vue {
@State shops: StoreState.shop[];
@State searchVal: string;

get shopList(): StoreState.shop[] {
const shops = this.shops;
const searchVal = this.searchVal;
return shops.filter(
(el: StoreState.shop) => el.shopName.indexOf(searchVal) > -1
);
}
}
</script>

如上代码中的 组件使用@Component @State之类的语法文档在那里呢





回答:

0条回复
撰写答案