diff --git a/packages/vue-cli-plugin-uni/lib/mp.js b/packages/vue-cli-plugin-uni/lib/mp.js index 2f2bb89e591134e9951c782ccc73d46c6eeb69e9..f5c748ea77078151ab2d0defb1d2a617a2d3a90b 100644 --- a/packages/vue-cli-plugin-uni/lib/mp.js +++ b/packages/vue-cli-plugin-uni/lib/mp.js @@ -1,10 +1,6 @@ const path = require('path') const webpack = require('webpack') -const moduleAlias = require('module-alias') -// TODO 重写 vue scoped(若升级 vue 编译器,需要确认该文件路径是否发生变化) -moduleAlias.addAlias('./stylePlugins/scoped', path.resolve(__dirname, './scoped.js')) - const { parseEntry, getMainEntry, diff --git a/packages/vue-cli-plugin-uni/lib/scoped.js b/packages/vue-cli-plugin-uni/lib/scoped.js deleted file mode 100644 index cf43883392b97893e5d5a9714a54e8803bf6d629..0000000000000000000000000000000000000000 --- a/packages/vue-cli-plugin-uni/lib/scoped.js +++ /dev/null @@ -1,83 +0,0 @@ -'use strict' -Object.defineProperty(exports, '__esModule', { value: true }) -const postcss = require('postcss') -// postcss-selector-parser does have typings but it's problematic to work with. -const selectorParser = require('postcss-selector-parser') -exports.default = postcss.plugin('add-id', (options) => (root) => { - const id = options - const keyframes = Object.create(null) - root.each(function rewriteSelector (node) { - if (!node.selector) { - // handle media queries - if (node.type === 'atrule') { - if (node.name === 'media' || node.name === 'supports') { - node.each(rewriteSelector) - } else if (/-?keyframes$/.test(node.name)) { - // register keyframes - keyframes[node.params] = node.params = node.params + '-' + id - } - } - return - } - node.selector = selectorParser((selectors) => { - selectors.each((selector) => { - let node = null - selector.each((n) => { - // ">>>" combinator - // and /deep/ alias for >>>, since >>> doesn't work in SASS - if (n.type === 'combinator' && - (n.value === '>>>' || n.value === '/deep/')) { - n.value = ' ' - n.spaces.before = n.spaces.after = '' - return false - } - if (n.type !== 'pseudo' && n.type !== 'combinator') { - node = n - } - }) - if (node) { - node.spaces.after = '' - } else { - // For deep selectors & standalone pseudo selectors, - // the attribute selectors are prepended rather than appended. - // So all leading spaces must be eliminated to avoid problems. - selector.first.spaces.before = '' - } - selector.insertAfter(node, selectorParser.className({ - value: id - })) - }) - }).processSync(node.selector) - }) - // If keyframes are found in this diff --git a/src/platforms/app-plus/view/framework/plugins/data.js b/src/platforms/app-plus/view/framework/plugins/data.js index c2acdeb0051ece49f35b906d82c85848684ce64e..eb1ee2d831f3f83bbd1079e2d155b7d0960d72fd 100644 --- a/src/platforms/app-plus/view/framework/plugins/data.js +++ b/src/platforms/app-plus/view/framework/plugins/data.js @@ -69,7 +69,7 @@ function broadcast (vm, componentName, eventName, ...params) { }) } -const NATIVE_COMPONENTS = ['Camera', 'LivePlayer', 'LivePusher', 'Map', 'Video', 'CoverView', 'CoverImage'] +const NATIVE_COMPONENTS = ['Camera', 'LivePlayer', 'LivePusher', 'Map', 'Video', 'CoverView', 'CoverImage', 'Ad'] function updateView () { const pages = getCurrentPages() @@ -81,7 +81,8 @@ function updateView () { ) } -window.addEventListener('resize', updateView) +window.addEventListener('resize', updateView) +window.addEventListener('updateview', updateView) function vdSync ({ data,