<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之类的语法文档在那里呢
找到了 https://cn.vuejs.org/v2/guide...