Closed hewson99 closed 1 year ago
//vue.config.js
const TransformPages = require('uni-read-pages')
const {webpack} = new TransformPages()
module.exports = {
configureWebpack: {
plugins: [
new webpack.DefinePlugin({
ROUTES: webpack.DefinePlugin.runtimeValue(() => {
const tfPages = new TransformPages({
includes: ['path', 'name', 'aliasPath']
});
return JSON.stringify(tfPages.routes)
}, true )
})
]
}
}
有
上传一个demo过来我这边排查下
const router = createRouter({ platform: process.env.UNI_PLATFORM, routes: [...ROUTES] });
sfc.d.ts文件已经加上了声明 import Vue from 'vue' declare module "vue/types/options" { type Hooks = App.AppInstance & Page.PageInstance; interface ComponentOptions extends Hooks {
/**