提交 096d38fe 编写于 作者: fxy060608's avatar fxy060608

Merge branch 'dev' of https://github.com/dcloudio/uni-app into alpha

# Conflicts:
#	packages/uni-quickapp-native/package.json
#	packages/uni-quickapp-webview/package.json
......@@ -51,18 +51,18 @@ dsl.onInitApp(function({
});`
})
const pageCode = pageOutput[0].code
const vueCode = fs.readFileSync(path.resolve(__dirname, '../packages/uni-quickapp-vue/assets/' + filename))
const vueCode = fs.readFileSync(path.resolve(__dirname, '../packages/uni-quickapp-native/assets/' + filename))
fs.writeFileSync(
path.resolve(__dirname, '../packages/uni-quickapp-vue/dist/' + filename),
path.resolve(__dirname, '../packages/uni-quickapp-native/dist/' + filename),
vueCode + bridgeCode + appCode + pageCode, {
encoding: 'utf8'
}
)
if (process.env.NODE_ENV === 'production') { // 命令会执行dev,prod两次,仅prod时执行copy
const componentsSrc = path.resolve(__dirname, '../src/platforms/quickapp-vue/view/components/**/*')
const componentsDest = path.resolve(__dirname, '../packages/uni-quickapp-vue/components')
const componentsSrc = path.resolve(__dirname, '../src/platforms/quickapp-native/view/components/**/*')
const componentsDest = path.resolve(__dirname, '../packages/uni-quickapp-native/components')
del.sync([componentsDest])
......
......@@ -23,9 +23,9 @@ const PLATFORMS = {
prefix: 'tt',
title: '头条小程序'
},
'quickapp-light': {
'quickapp-webview': {
prefix: 'qa',
title: '快应用(Light)版'
title: '快应用(Webview)版'
},
'app-plus': {
prefix: 'wx',
......
......@@ -6,7 +6,7 @@ const commonjs = require('@rollup/plugin-commonjs')
const terser = require('rollup-plugin-terser')
const requireContext = require('../lib/rollup-plugin-require-context')
process.env.UNI_PLATFORM = 'quickapp-vue'
process.env.UNI_PLATFORM = 'quickapp-native'
const external = []
......@@ -36,7 +36,7 @@ alias({
replacement: resolve('src/core')
}, {
find: 'uni-platform',
replacement: resolve('src/platforms/quickapp-vue')
replacement: resolve('src/platforms/quickapp-native')
}, {
find: 'uni-platforms',
replacement: resolve('src/platforms')
......@@ -48,10 +48,10 @@ alias({
replacement: resolve('src/core/helpers')
}, {
find: 'uni-invoke-api',
replacement: resolve('src/platforms/quickapp-vue/service/invoke-api')
replacement: resolve('src/platforms/quickapp-native/service/invoke-api')
}, {
find: 'uni-service-api',
replacement: resolve('src/platforms/quickapp-vue/service/api')
replacement: resolve('src/platforms/quickapp-native/service/api')
}, {
find: 'uni-api-protocol',
replacement: resolve('src/core/helpers/protocol')
......@@ -62,7 +62,7 @@ requireContext(),
commonjs(),
replace({
__PLATFORM__: JSON.stringify(process.env.UNI_PLATFORM),
__PLATFORM_TITLE__: '快应用(Vue)版'
__PLATFORM_TITLE__: '快应用(Native)版'
})
]
......@@ -74,11 +74,11 @@ module.exports = function (type) {
let input = ''
if (type === 'bridge') {
input = 'src/platforms/quickapp-vue/runtime/bridge.js'
input = 'src/platforms/quickapp-native/runtime/bridge.js'
} else if (type === 'app') {
input = 'src/platforms/quickapp-vue/runtime/app.js'
input = 'src/platforms/quickapp-native/runtime/app.js'
} else if (type === 'page') {
input = 'src/platforms/quickapp-vue/runtime/page.js'
input = 'src/platforms/quickapp-native/runtime/page.js'
}
return {
......
......@@ -18,11 +18,11 @@
"build:mp-baidu": "cross-env UNI_PLATFORM=mp-baidu rollup -c build/rollup.config.mp.js",
"build:mp-alipay": "cross-env UNI_PLATFORM=mp-alipay rollup -c build/rollup.config.mp.js",
"build:mp-toutiao": "cross-env UNI_PLATFORM=mp-toutiao rollup -c build/rollup.config.mp.js",
"build:quickapp-light": "cross-env UNI_PLATFORM=quickapp-light rollup -c build/rollup.config.mp.js",
"build:quickapp-webview": "cross-env UNI_PLATFORM=quickapp-webview rollup -c build/rollup.config.mp.js",
"build:mp-weixin:mp": "cross-env UNI_PLATFORM=mp-weixin UNI_MP=true rollup -c build/rollup.config.mp.js",
"build:mp-weixin:wxs": "rollup -c build/rollup.config.wxs.js",
"build:quickapp-vue": "cross-env NODE_ENV=development node build/build.qa.js && cross-env NODE_ENV=production node build/build.qa.js",
"build:runtime": "npm run lint && npm run build:mp-weixin && npm run build:mp-qq && npm run build:mp-alipay && npm run build:mp-baidu && npm run build:mp-toutiao && npm run build:app-plus && npm run build:quickapp-light && npm run build:quickapp-vue",
"build:quickapp-native": "cross-env NODE_ENV=development node build/build.qa.js && cross-env NODE_ENV=production node build/build.qa.js",
"build:runtime": "npm run lint && npm run build:mp-weixin && npm run build:mp-qq && npm run build:mp-alipay && npm run build:mp-baidu && npm run build:mp-toutiao && npm run build:app-plus && npm run build:quickapp-webview && npm run build:quickapp-native",
"build:stat": "npm run lint && rollup -c build/rollup.config.stat.js",
"build:web-view": "rollup -c build/rollup.config.web-view.js",
"test:cli": "cross-env NODE_ENV=test jest",
......
......@@ -359,10 +359,10 @@ function initAutoImportScanComponents () {
const components = getAutoComponentsByDir(componentsPath)
if (process.env.UNI_PLATFORM === 'quickapp-vue') {
if (process.env.UNI_PLATFORM === 'quickapp-native') {
if (!uniQuickAppAutoImportScanComponents) {
uniQuickAppAutoImportScanComponents = getAutoComponentsByDir(
path.resolve(require.resolve('@dcloudio/uni-quickapp-vue'), '../../components'),
path.resolve(require.resolve('@dcloudio/uni-quickapp-native'), '../../components'),
true
)
}
......
const migrate = require('../lib/index')
// const migrate = require('../lib/index')
migrate('/Users/fxy/Downloads/wa-vantui_1.1')
// migrate('/Users/fxy/Downloads/wa-vantui_1.1')
// migrate('/Users/fxy/Downloads/wa-vantui_1.1/pages')
// const {
// parse
// } = require('mustache')
// console.log(parse("van-notice-bar__content {{ !scrollable && !wrapable ? 'van-ellipsis' : '' }}"))
const {
parse
} = require('mustache')
function parseMustache(expr, identifier = false) {
if (!expr) {
return ''
}
const tokens = parse(expr)
const isIdentifier = tokens.length === 1
return tokens.map(token => {
if (token[0] === 'text') {
if (identifier) {
return token[1]
}
return `'${token[1]}'`
} else if (token[0] === '!') { // {{ !loading }}
return `(!${token[1]})`
} else if (token[0] === 'name') {
if (isIdentifier) {
return token[1]
}
return `(${token[1]})`
}
}).join('+')
}
console.log(parseMustache("click ",true)==='click ')
// const {
// transformTemplate
......
......@@ -9,11 +9,11 @@ describe('wxml:compiler', () => {
it('generate event', () => {
assertCodegen(
`<view bindtouchstart="startDrag" catchtouchmove="{{ catchMove ? 'noop' : '' }}"/>`,
`<uni-shadow-root><view @touchstart="startDrag" @touchmove.stop.prevent="catchMove ? 'noop' : ''"></view></uni-shadow-root>`
`<uni-shadow-root><view @touchstart="startDrag" @touchmove.stop.prevent="_$self[(catchMove ? 'noop' : '')||'_$noop']($event)"></view></uni-shadow-root>`
)
assertCodegen(
`<uni-transition bind:click="click" bindtouchstart="startDrag" catchtouchmove="{{ catchMove ? 'noop' : '' }}"/>`,
`<uni-shadow-root><uni-transition @click="click" @touchstart.native="startDrag" @touchmove.native.stop.prevent="catchMove ? 'noop' : ''"></uni-transition></uni-shadow-root>`
`<uni-shadow-root><uni-transition @click="click" @touchstart.native="startDrag" @touchmove.native.stop.prevent="_$self[(catchMove ? 'noop' : '')||'_$noop']($event)"></uni-transition></uni-shadow-root>`
)
})
it('generate class', () => {
......
......@@ -127,7 +127,7 @@ function transformFor(attribs) {
if (vKey) {
if (vKey === '*this') {
vKey = vItem
} else if (vKey !== vItem && vKey.indexOf('.')===-1) {// wx:for-key="{{item.value}}"
} else if (vKey !== vItem && vKey.indexOf('.') === -1) { // wx:for-key="{{item.value}}"
vKey = vItem + '.' + vKey
}
attribs[':key'] = vKey
......@@ -163,7 +163,11 @@ function transformEvent(name, value, attribs, state) {
event = transformEventName(name.replace(captureCatchRE, ''), state) + '.stop.prevent.capture'
}
if (event !== name) {
attribs[event] = parseMustache(value, true)
let newValue = parseMustache(value, true)
if (newValue !== value) {
newValue = `_$self[(${newValue})||'_$noop']($event)`
}
attribs[event] = newValue
return true
}
}
......
......@@ -758,6 +758,9 @@ var polyfill = {
beforeCreate () {
// 取消 development 时的 Proxy,避免小程序组件模板中使用尚未定义的属性告警
this._renderProxy = this;
this._$self = this;
this._$noop = noop;
},
created () { // properties 中可能会访问 methods,故需要在 created 中初始化
initState(this);
......
......@@ -24,7 +24,7 @@ function getProjectName(e, t) {
const stripJsonComments = require('strip-json-comments');
const r = _path.default.join(e, t, "manifest.json");
const s = JSON.parse(stripJsonComments(_fs.default.readFileSync(r).toString()))
return s && s['quickapp-vue'] && s['quickapp-vue']['package'] || s.name || "Bundle"
return s && s['quickapp-native'] && s['quickapp-native']['package'] || s.name || "Bundle"
} catch (e) {
_sharedUtils.colorconsole.error(`### App Server ### 获取项目名称出错:${e.message}`)
}
......@@ -50,7 +50,7 @@ function getDistFilePath(e, t, r) {
let s;
if (!process.env.UNI_OUTPUT_DIR) {
const mode = process.env.NODE_ENV === 'production' ? 'build' : 'dev'
process.env.UNI_OUTPUT_DIR = _path.default.join(process.cwd(), 'dist/' + mode + '/quickapp-vue')
process.env.UNI_OUTPUT_DIR = _path.default.join(process.cwd(), 'dist/' + mode + '/quickapp-native')
}
return s = _path.default.join(process.env.UNI_OUTPUT_DIR, `${t}.debug.${r}`), _fs.default.existsSync(s) ? s : (s =
_path.default.join(e,
......
......@@ -7,7 +7,7 @@ module.exports = config => {
.use('vue-loader')
.loader(vueLoader.loader)
.tap(options => Object.assign(options, vueLoader.options({}, {
'quickapp-vue': true
'quickapp-native': true
})))
config.module
......
......@@ -6,7 +6,7 @@ const PLATFORMS = [
'mp-baidu',
'mp-alipay',
'mp-toutiao',
'quickapp-vue'
'quickapp-native'
]
const DISPLAY = {
......@@ -44,8 +44,8 @@ function parseStyle(style = {}) {
}
}
})
if (style['quickapp-vue']) {
Object.assign(ret, style['quickapp-vue'])
if (style['quickapp-native']) {
Object.assign(ret, style['quickapp-native'])
}
return ret
}
......
......@@ -27,7 +27,7 @@ function getPages(pagesJson) {
module.exports = function(pagesJson, manifestJson, loader) {
const manifest = manifestJson['quickapp-vue'] || {}
const manifest = manifestJson['quickapp-native'] || {}
parseBase(manifest, manifestJson)
......
......@@ -5,7 +5,7 @@ module.exports = function () {
const manifest = global.framework.manifest
if (manifest.package === 'Bundle') {
console.error('> 建议配置 manifest.json->quickapp-vue->package 应用包名')
console.error('> 建议配置 manifest.json->quickapp-native->package 应用包名')
}
const signPath = './sign/' + (process.env.NODE_ENV === 'production' ? 'release' : 'debug')
......
{
"name": "@dcloudio/uni-quickapp-vue",
"version": "2.0.0-alpha-27020200429001",
"description": "uni-app quickapp-vue",
"name": "@dcloudio/uni-quickapp-native",
"version": "2.0.0-alpha-26920200407011",
"description": "uni-app quickapp-native",
"main": "dist/vue.prod.js",
"repository": {
"type": "git",
"url": "git+https://github.com/dcloudio/uni-app.git",
"directory": "packages/uni-quickapp-vue"
"directory": "packages/uni-quickapp-native"
},
"files": [
"bin",
......@@ -21,7 +21,7 @@
"license": "Apache-2.0",
"gitHead": "5ed6c58ef3a74a43b11bd65f8f6f488e470716c8",
"uni-app": {
"name": "quickapp-vue",
"name": "quickapp-native",
"title": "快应用(Vue)版"
},
"dependencies": {
......
......@@ -417,7 +417,7 @@ function processArgs (methodName, fromArgs, argsOption = {}, returnValue = {}, k
keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
}
if (!keyOption) { // 不支持的参数
console.warn(`快应用(Light)版 ${methodName}暂不支持${key}`);
console.warn(`快应用(Webview)版 ${methodName}暂不支持${key}`);
} else if (isStr(keyOption)) { // 重写参数 key
toArgs[keyOption] = fromArgs[key];
} else if (isPlainObject(keyOption)) { // {name:newName,value:value}可重新指定参数 key:value
......@@ -450,7 +450,7 @@ function wrapper (methodName, method) {
const protocol = protocols[methodName];
if (!protocol) { // 暂不支持的 api
return function () {
console.error(`快应用(Light)版 暂不支持${methodName}`);
console.error(`快应用(Webview)版 暂不支持${methodName}`);
}
}
return function (arg1, arg2) { // 目前 api 最多两个参数
......@@ -1146,7 +1146,7 @@ function parseBaseApp (vm, {
Vue.prototype.$store = vm.$options.store;
}
Vue.prototype.mpHost = "quickapp-light";
Vue.prototype.mpHost = "quickapp-webview";
Vue.mixin({
beforeCreate () {
......@@ -1580,7 +1580,7 @@ canIUses.forEach(canIUseApi => {
let uni = {};
if (typeof Proxy !== 'undefined' && "quickapp-light" !== 'app-plus') {
if (typeof Proxy !== 'undefined' && "quickapp-webview" !== 'app-plus') {
uni = new Proxy({}, {
get (target, name) {
if (target[name]) {
......
......@@ -31,10 +31,10 @@ module.exports = {
},
validate (platformOptions, manifestJson) {
if (!platformOptions.package) {
console.warn('manifest.json->quickapp-light 缺少 package 配置')
console.warn('manifest.json->quickapp-webview 缺少 package 配置')
}
if (!platformOptions.icon) {
console.warn('manifest.json->quickapp-light 缺少 icon 配置')
console.warn('manifest.json->quickapp-webview 缺少 icon 配置')
}
},
copyWebpackOptions (platformOptions, vueOptions) {
......
{
"name": "@dcloudio/uni-quickapp-light",
"version": "2.0.0-alpha-27020200429001",
"description": "uni-app quickapp-light",
"name": "@dcloudio/uni-quickapp-webview",
"version": "2.0.0-alpha-26920200407011",
"description": "uni-app quickapp-webview",
"main": "dist/index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/dcloudio/uni-app.git",
"directory": "packages/uni-quickapp-light"
"directory": "packages/uni-quickapp-webview"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
......@@ -14,8 +14,8 @@
"author": "fxy060608",
"license": "Apache-2.0",
"uni-app": {
"name": "quickapp-light",
"title": "快应用(Light)版"
"name": "quickapp-webview",
"title": "快应用(Webview)版"
},
"gitHead": "56868b5e04d0c94c33e40d13f26937b43ea05156"
"gitHead": "5ed6c58ef3a74a43b11bd65f8f6f488e470716c8"
}
......@@ -6,7 +6,7 @@ function assertCodegen (template, templateCode, renderCode = 'with(this){}', opt
mp: Object.assign({
minified: true,
isTest: true,
platform: 'quickapp-light'
platform: 'quickapp-webview'
}, options)
})
......@@ -14,7 +14,7 @@ function assertCodegen (template, templateCode, renderCode = 'with(this){}', opt
expect(res.render).toBe(renderCode)
}
describe('mp:compiler-quickapp-light', () => {
describe('mp:compiler-quickapp-webview', () => {
it('generate v-for directive', () => {
assertCodegen(
'<view><view v-for="(item,index) in items" :key="index"></view></view>',
......
......@@ -86,7 +86,7 @@ function compileTemplate (source, options, compile) {
const compilerModule = {
preTransformNode (el, options) {
if (process.env.UNI_PLATFORM === 'quickapp-vue') {
if (process.env.UNI_PLATFORM === 'quickapp-native') {
// 排查所有标签
(options.isUnaryTag.autoComponents || (options.isUnaryTag.autoComponents = new Set())).add(el.tag)
} else if (isComponent(el.tag) && el.tag !== 'App') { // App.vue
......
......@@ -78,12 +78,12 @@ module.exports = {
console.error(source)
throw e
}
} else if (options['quickapp-vue']) {
} else if (options['quickapp-native']) {
// 后续改版,应统一由具体包实现
(options.modules || (options.modules = [])).push(require('@dcloudio/uni-quickapp-vue/lib/compiler-module'))
(options.modules || (options.modules = [])).push(require('@dcloudio/uni-quickapp-native/lib/compiler-module'))
}
if (!options.mp) { // h5,quickapp-vue
if (!options.mp) { // h5,quickapp-native
return compileTemplate(source, options, compile)
}
......
......@@ -9,23 +9,23 @@ module.exports = (api, options, rootOptions) => {
info: 'node node_modules/@dcloudio/vue-cli-plugin-uni/commands/info.js',
serve: 'npm run dev:h5',
build: 'npm run build:h5',
'serve:quickapp-vue': 'node node_modules/@dcloudio/uni-quickapp-vue/bin/serve.js',
'serve:quickapp-native': 'node node_modules/@dcloudio/uni-quickapp-native/bin/serve.js',
'dev:h5': 'cross-env NODE_ENV=development UNI_PLATFORM=h5 vue-cli-service uni-serve',
'dev:mp-qq': 'cross-env NODE_ENV=development UNI_PLATFORM=mp-qq vue-cli-service uni-build --watch',
'dev:mp-weixin': 'cross-env NODE_ENV=development UNI_PLATFORM=mp-weixin vue-cli-service uni-build --watch',
'dev:mp-baidu': 'cross-env NODE_ENV=development UNI_PLATFORM=mp-baidu vue-cli-service uni-build --watch',
'dev:mp-alipay': 'cross-env NODE_ENV=development UNI_PLATFORM=mp-alipay vue-cli-service uni-build --watch',
'dev:mp-toutiao': 'cross-env NODE_ENV=development UNI_PLATFORM=mp-toutiao vue-cli-service uni-build --watch',
'dev:quickapp-vue': 'cross-env NODE_ENV=development UNI_PLATFORM=quickapp-vue vue-cli-service uni-build --watch',
'dev:quickapp-light': 'cross-env NODE_ENV=development UNI_PLATFORM=quickapp-light vue-cli-service uni-build --watch',
'dev:quickapp-native': 'cross-env NODE_ENV=development UNI_PLATFORM=quickapp-native vue-cli-service uni-build --watch',
'dev:quickapp-webview': 'cross-env NODE_ENV=development UNI_PLATFORM=quickapp-webview vue-cli-service uni-build --watch',
'build:h5': 'cross-env NODE_ENV=production UNI_PLATFORM=h5 vue-cli-service uni-build',
'build:mp-qq': 'cross-env NODE_ENV=production UNI_PLATFORM=mp-qq vue-cli-service uni-build',
'build:mp-weixin': 'cross-env NODE_ENV=production UNI_PLATFORM=mp-weixin vue-cli-service uni-build',
'build:mp-baidu': 'cross-env NODE_ENV=production UNI_PLATFORM=mp-baidu vue-cli-service uni-build',
'build:mp-alipay': 'cross-env NODE_ENV=production UNI_PLATFORM=mp-alipay vue-cli-service uni-build',
'build:mp-toutiao': 'cross-env NODE_ENV=production UNI_PLATFORM=mp-toutiao vue-cli-service uni-build',
'build:quickapp-vue': 'cross-env NODE_ENV=production UNI_PLATFORM=quickapp-vue vue-cli-service uni-build',
'build:quickapp-light': 'cross-env NODE_ENV=production UNI_PLATFORM=quickapp-light vue-cli-service uni-build',
'build:quickapp-native': 'cross-env NODE_ENV=production UNI_PLATFORM=quickapp-native vue-cli-service uni-build',
'build:quickapp-webview': 'cross-env NODE_ENV=production UNI_PLATFORM=quickapp-webview vue-cli-service uni-build',
'dev:custom': 'cross-env NODE_ENV=development uniapp-cli custom',
'build:custom': 'cross-env NODE_ENV=production uniapp-cli custom',
'test:h5': 'cross-env UNI_PLATFORM=h5 jest -i',
......@@ -45,8 +45,8 @@ module.exports = (api, options, rootOptions) => {
'@dcloudio/uni-mp-baidu': version,
'@dcloudio/uni-mp-alipay': version,
'@dcloudio/uni-mp-toutiao': version,
'@dcloudio/uni-quickapp-light': version,
'@dcloudio/uni-quickapp-vue': version,
'@dcloudio/uni-quickapp-webview': version,
'@dcloudio/uni-quickapp-native': version,
'@dcloudio/uni-stat': version,
flyio: '^0.6.2',
vuex: '^3.2.0'
......
......@@ -19,7 +19,7 @@ module.exports = (api, options) => {
initBuildCommand(api, options)
if (process.env.UNI_PLATFORM === 'quickapp-vue') {
if (process.env.UNI_PLATFORM === 'quickapp-native') {
process.env.UNI_OUTPUT_DIR = path.resolve(process.env.UNI_OUTPUT_DIR, 'build')
Object.assign(options, {
assetsDir,
......@@ -35,7 +35,7 @@ module.exports = (api, options) => {
api.configureWebpack(require('./lib/configure-webpack')(platformOptions, manifestPlatformOptions, options, api))
api.chainWebpack(require('./lib/chain-webpack')(platformOptions, options, api))
const vueConfig = require('@dcloudio/uni-quickapp-vue/lib/vue.config.js')
const vueConfig = require('@dcloudio/uni-quickapp-native/lib/vue.config.js')
api.configureWebpack(vueConfig.configureWebpack)
api.chainWebpack(vueConfig.chainWebpack)
return
......
......@@ -198,19 +198,22 @@ module.exports = function configureWebpack (platformOptions, manifestPlatformOpt
plugins.push(new CopyWebpackPlugin(getCopyWebpackPluginOptions(manifestPlatformOptions, vueOptions)))
}
plugins.push(new CopyWebpackPlugin([{
from: require.resolve('@dcloudio/uni-automator/dist/automator.json'),
to: '../.automator/' + (process.env.UNI_SUB_PLATFORM || process.env.UNI_PLATFORM) +
'/.automator.json',
transform (content) {
if (process.env.UNI_AUTOMATOR_WS_ENDPOINT) {
return JSON.stringify({
wsEndpoint: process.env.UNI_AUTOMATOR_WS_ENDPOINT
})
try {
const automatorJson = require.resolve('@dcloudio/uni-automator/dist/automator.json')
plugins.push(new CopyWebpackPlugin([{
from: automatorJson,
to: '../.automator/' + (process.env.UNI_SUB_PLATFORM || process.env.UNI_PLATFORM) +
'/.automator.json',
transform (content) {
if (process.env.UNI_AUTOMATOR_WS_ENDPOINT) {
return JSON.stringify({
wsEndpoint: process.env.UNI_AUTOMATOR_WS_ENDPOINT
})
}
return ''
}
return ''
}
}]))
}]))
} catch (e) {}
if (process.UNI_SCRIPT_ENV && Object.keys(process.UNI_SCRIPT_ENV).length) {
// custom define
......
......@@ -289,7 +289,7 @@ if (process.env.UNI_USING_NATIVE || process.env.UNI_USING_V3_NATIVE) {
console.log('当前nvue编译模式' + (process.env.UNI_USING_V3_NATIVE ? '(v3)' : '') + '' + (isNVueCompiler ? 'uni-app'
: 'weex') +
' 。编译模式差异见:https://ask.dcloud.net.cn/article/36074')
} else if (process.env.UNI_PLATFORM !== 'h5' && process.env.UNI_PLATFORM !== 'quickapp-vue') {
} else if (process.env.UNI_PLATFORM !== 'h5' && process.env.UNI_PLATFORM !== 'quickapp-native') {
try {
let info = ''
if (process.env.UNI_PLATFORM === 'app-plus') {
......
......@@ -241,7 +241,7 @@ if (process.env.UNI_USING_V3) {
// Transform each property declaration here
decl.value = tranformValue(decl, opts)
})
if (process.env.UNI_PLATFORM !== 'quickapp-vue') {
if (process.env.UNI_PLATFORM !== 'quickapp-native') {
rule.selectors = rule.selectors.map(complexSelector => {
return transformSelector(complexSelector, simpleSelectors => {
return simpleSelectors.walkTags(tag => {
......
......@@ -69,8 +69,8 @@ module.exports = function (content) {
if (process.env.UNI_PLATFORM === 'h5') {
return require('./platforms/h5')(pagesJson, manifestJson, this)
}
if (process.env.UNI_PLATFORM === 'quickapp-vue') {
return require('./platforms/quickapp-vue')(pagesJson, manifestJson, this)
if (process.env.UNI_PLATFORM === 'quickapp-native') {
return require('./platforms/quickapp-native')(pagesJson, manifestJson, this)
}
if (!process.env.UNI_USING_V3) {
......
......@@ -44,7 +44,7 @@ module.exports = function (content) {
if (
process.env.UNI_USING_COMPONENTS ||
process.env.UNI_PLATFORM === 'h5' ||
process.env.UNI_PLATFORM === 'quickapp-vue'
process.env.UNI_PLATFORM === 'quickapp-native'
) {
return require('./index-new').call(this, content)
}
......
module.exports = function (pagesJson, manifestJson, loader) {
return require('@dcloudio/uni-quickapp-vue/lib/manifest')(pagesJson, manifestJson, loader)
return require('@dcloudio/uni-quickapp-native/lib/manifest')(pagesJson, manifestJson, loader)
}
......@@ -16,7 +16,7 @@ module.exports = function (pagesJson, manifestJson) {
manifestJson.versionName && (baseJson.versionName = manifestJson.versionName)
manifestJson.versionCode && (baseJson.versionCode = manifestJson.versionCode)
Object.assign(app.content, baseJson, manifestJson['quickapp-light'] || {})
Object.assign(app.content, baseJson, manifestJson['quickapp-webview'] || {})
if (!app.content.package) {
app.content.package = manifestJson.name
......
import {
noop
} from 'uni-shared'
import {
initState
} from './state/index'
......@@ -19,6 +23,9 @@ export default {
beforeCreate () {
// 取消 development 时的 Proxy,避免小程序组件模板中使用尚未定义的属性告警
this._renderProxy = this
this._$self = this
this._$noop = noop
},
created () { // properties 中可能会访问 methods,故需要在 created 中初始化
initState(this)
......
......@@ -25,7 +25,7 @@ import {
} from 'uni-platforms/mp-weixin/runtime/web-view'
import {
initWebviewApi as initQuickappWebviewApi
} from 'uni-platforms/quickapp-light/runtime/web-view'
} from 'uni-platforms/quickapp-webview/runtime/web-view'
const UniAppJSBridgeReady = function () {
window.UniAppJSBridge = true
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册