提交 193a8e06 编写于 作者: fxy060608's avatar fxy060608

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

...@@ -638,7 +638,7 @@ class Util { ...@@ -638,7 +638,7 @@ class Util {
} }
this._sendRequest(optionsData); this._sendRequest(optionsData);
} }
_sendRequest(optionsData){ _sendRequest(optionsData) {
uni.request({ uni.request({
url: STAT_URL, url: STAT_URL,
method: 'POST', method: 'POST',
...@@ -775,15 +775,17 @@ class Stat extends Util { ...@@ -775,15 +775,17 @@ class Stat extends Util {
show(self) { show(self) {
this.self = self; this.self = self;
if (!getPageTypes(self)) { if (!getPageTypes(self)) {
this._pageShow(self);
} else {
this._applicationShow(self); this._applicationShow(self);
} }
} }
ready(self) { ready(self) {
this.self = self; // this.self = self;
if (getPageTypes(self)) { // if (getPageTypes(self)) {
this._pageShow(self); // this._pageShow(self);
} // }
} }
hide(self) { hide(self) {
this.self = self; this.self = self;
......
...@@ -373,7 +373,7 @@ class Util { ...@@ -373,7 +373,7 @@ class Util {
} }
this._sendRequest(optionsData) this._sendRequest(optionsData)
} }
_sendRequest(optionsData){ _sendRequest(optionsData) {
uni.request({ uni.request({
url: STAT_URL, url: STAT_URL,
method: 'POST', method: 'POST',
...@@ -509,16 +509,18 @@ class Stat extends Util { ...@@ -509,16 +509,18 @@ class Stat extends Util {
show(self) { show(self) {
this.self = self; this.self = self;
if (!getPageTypes(self)) { if (getPageTypes(self)) {
this._pageShow(self);
} else {
this._applicationShow(self); this._applicationShow(self);
} }
} }
ready(self) { ready(self) {
this.self = self; // this.self = self;
if (getPageTypes(self)) { // if (getPageTypes(self)) {
this._pageShow(self); // this._pageShow(self);
} // }
} }
hide(self) { hide(self) {
this.self = self; this.self = self;
......
...@@ -12,6 +12,7 @@ const { ...@@ -12,6 +12,7 @@ const {
const WebpackAppPlusNVuePlugin = require('../packages/webpack-app-plus-nvue-plugin') const WebpackAppPlusNVuePlugin = require('../packages/webpack-app-plus-nvue-plugin')
const WebpackErrorsPlugin = require('@dcloudio/vue-cli-plugin-uni/packages/webpack-errors-plugin') const WebpackErrorsPlugin = require('@dcloudio/vue-cli-plugin-uni/packages/webpack-errors-plugin')
const WebpackUniMPPlugin = require('@dcloudio/webpack-uni-mp-loader/lib/plugin/index-new')
const onErrors = require('@dcloudio/vue-cli-plugin-uni/util/on-errors') const onErrors = require('@dcloudio/vue-cli-plugin-uni/util/on-errors')
...@@ -146,6 +147,7 @@ if (process.env.UNI_USING_NVUE_COMPILER) { ...@@ -146,6 +147,7 @@ if (process.env.UNI_USING_NVUE_COMPILER) {
}) })
} }
if (process.env.UNI_USING_NATIVE) { if (process.env.UNI_USING_NATIVE) {
plugins.push(new WebpackUniMPPlugin())
plugins.push(new CopyWebpackPlugin([{ plugins.push(new CopyWebpackPlugin([{
from: path.resolve(process.env.UNI_INPUT_DIR, 'static'), from: path.resolve(process.env.UNI_INPUT_DIR, 'static'),
to: 'static' to: 'static'
...@@ -170,13 +172,15 @@ if (process.env.UNI_USING_NATIVE) { ...@@ -170,13 +172,15 @@ if (process.env.UNI_USING_NATIVE) {
}])) }]))
} }
module.exports = function (entry) { module.exports = function () {
return { return {
target: 'node', // 激活 vue-loader 的 isServer 逻辑 target: 'node', // 激活 vue-loader 的 isServer 逻辑
mode: process.env.NODE_ENV, mode: process.env.NODE_ENV,
devtool: process.env.NODE_ENV === 'development' ? 'inline-source-map' : false, devtool: process.env.NODE_ENV === 'development' ? 'inline-source-map' : false,
watch: process.env.NODE_ENV === 'development', watch: process.env.NODE_ENV === 'development',
entry, entry () {
return process.UNI_NVUE_ENTRY
},
externals: { externals: {
'vue': 'Vue' 'vue': 'Vue'
}, },
......
...@@ -67,6 +67,7 @@ function addSubPackagesRequire (compilation) { ...@@ -67,6 +67,7 @@ function addSubPackagesRequire (compilation) {
class WebpackUniMPPlugin { class WebpackUniMPPlugin {
apply (compiler) { apply (compiler) {
if (!process.env.UNI_USING_NATIVE) {
compiler.hooks.emit.tapPromise('webpack-uni-mp-emit', compilation => { compiler.hooks.emit.tapPromise('webpack-uni-mp-emit', compilation => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
addSubPackagesRequire(compilation) addSubPackagesRequire(compilation)
...@@ -85,7 +86,7 @@ class WebpackUniMPPlugin { ...@@ -85,7 +86,7 @@ class WebpackUniMPPlugin {
resolve() resolve()
}) })
}) })
}
compiler.hooks.invalid.tap('webpack-uni-mp-invalid', (fileName, changeTime) => { compiler.hooks.invalid.tap('webpack-uni-mp-invalid', (fileName, changeTime) => {
if ( if (
fileName && fileName &&
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册