1.0.5 • Published 2 years ago

shst-campus-components v1.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

SHST-CAMPUS

将版本库依赖加入uniapp-cli构建的TS模板项目,例如https://github.com/SHST-SDUST/SHST-UNI

$ yarn add shst-campus-components

配置vue.config.jstsconfig.json

// vue.config.js
const path = require("path");
module.exports = {
  transpileDependencies: ["shst-campus-components"],
    configureWebpack: {
        resolve: {
            alias: {
                "@": path.join(__dirname, "./src"),
                "@campus": path.join(__dirname, "./node_modules/shst-campus-components"),
            },
        },
    },
};
// tsconfig.json
{
  "compilerOptions": {
    // ...
    "paths": {
      "@/*": [
        "./src/*"
      ],
      "@campus/*": [
        "./node_modules/shst-campus-components/*"
      ]
    },
    // ...
}

使用组件库,具体请参考https://github.com/WindrunnerMax/Campus

// ...
import CCard from "@campus/c-card/c-card.vue";
// ...