store插件使用
文章目录
导入store的两种办法
1、
npm install store --save-dev
在angular.cli的script标签中添加
"styles": [
"styles.css"
],
"scripts": [
"./node_modules/store/dist/store.legacy.min.js"
],
在需要的地方直接引入
import store from store;
2、在index.html文件中<script>
<script src="https://cdn.bootcss.com/store.js/1.3.20/store.js"></script>
定义全局变量就可以使用了
declare var store;
...
export class HomePage {
constructor() {
console.log(store.enabled, "info");
}
}
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论