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

wip(app): nvue

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