提交 75b7a9b9 编写于 作者: fxy060608's avatar fxy060608

wip(app): nvue

上级 081f069c
......@@ -5,6 +5,7 @@ declare var qa: any
declare var swan: any
declare var qq: any
declare var ks: any
declare var __NVUE__: undefined | boolean
declare var __PLATFORM__: UniApp.PLATFORM
declare var __PLATFORM_PREFIX__:
| 'wx'
......
......@@ -24,6 +24,7 @@
"inlineDynamicImports": true
},
"replacements": {
"__NVUE__": "false",
"__PLATFORM__": "'app'",
"__APP_VIEW__": "false",
"__VUE_OPTIONS_API__": "true",
......
......@@ -57,6 +57,7 @@ export default defineConfig({
define: {
global: 'window',
__DEV__: false,
__NVUE__: false,
__TEST__: false,
__PLATFORM__: JSON.stringify('app'),
__NODE_JS__: false,
......
[
{
"input": {
"src/nvue/bridge.ts": ["dist/bridge.js"]
"src/nvue/index.ts": ["dist/nvue.js"]
},
"replacements": {
"__NVUE__": "true",
"__PLATFORM__": "'app'",
"__APP_VIEW__": "false",
"__VUE_OPTIONS_API__": "true",
"__VUE_PROD_DEVTOOLS__": "false",
"__UNI_FEATURE_WX__": "false",
"__UNI_FEATURE_PROMISE__": "false",
"__UNI_FEATURE_I18N_EN__": "true",
"__UNI_FEATURE_I18N_ES__": "true",
"__UNI_FEATURE_I18N_FR__": "true",
"__UNI_FEATURE_I18N_ZH_HANS__": "true",
"__UNI_FEATURE_I18N_ZH_HANT__": "true"
}
}
]
......@@ -118,10 +118,10 @@ export function initComponents({ uni, Vue, weex, plus, BroadcastChannel, UniView
};
}
});
var index = {
var components2 = {
Navigator
};
return index;
return components2;
}(Vue, VueShared);
return components;
}
import { initBridge } from '@dcloudio/uni-core'
export const UniViewJSBridge = initBridge('nvue')
import Navigator from './navigator'
export default {
Navigator,
}
import Navigator from './navigator'
export default {
Navigator,
}
import { initBridge } from '@dcloudio/uni-core'
export const UniViewJSBridge = initBridge('nvue')
......@@ -9,6 +9,10 @@ function resolve(file: string) {
export default defineConfig({
root: __dirname,
define: {
global: 'window',
__NVUE__: true,
},
resolve: {
alias: [
{
......@@ -21,7 +25,7 @@ export default defineConfig({
minify: false,
lib: {
name: 'components',
entry: path.resolve(__dirname, 'src/nvue/index.ts'),
entry: path.resolve(__dirname, 'src/nvue/components.ts'),
formats: ['iife'],
},
rollupOptions: {
......
......@@ -14,7 +14,7 @@ export function applyOptions(
instance: ComponentInternalInstance,
publicThis: ComponentPublicInstance
) {
if (__PLATFORM__ === 'app') {
if (__PLATFORM__ === 'app' && !__NVUE__) {
initWxs(options, instance)
initRenderjs(options, instance)
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册