fix(Popover): failed to compile

This commit is contained in:
chenjiahan 2020-11-25 21:50:55 +08:00 committed by neverland
parent c8ef32d344
commit f3ad7ed1a7
4 changed files with 11 additions and 11 deletions

View File

@ -55,6 +55,7 @@
"dependencies": { "dependencies": {
"@babel/runtime": "7.x", "@babel/runtime": "7.x",
"@vant/icons": "1.4.0", "@vant/icons": "1.4.0",
"@vant/popperjs": "^1.0.0",
"@vue/babel-helper-vue-jsx-merge-props": "^1.0.0", "@vue/babel-helper-vue-jsx-merge-props": "^1.0.0",
"vue-lazyload": "1.2.3" "vue-lazyload": "1.2.3"
}, },

View File

@ -5,7 +5,8 @@
"main": "lib/index.js", "main": "lib/index.js",
"types": "lib/index.d.ts", "types": "lib/index.d.ts",
"publishConfig": { "publishConfig": {
"access": "public" "access": "public",
"registry": "https://registry.npmjs.org/"
}, },
"scripts": { "scripts": {
"dev": "rollup --config rollup.config.js --watch", "dev": "rollup --config rollup.config.js --watch",

View File

@ -1,6 +1,4 @@
import { createPopper } from '@popperjs/core/lib/popper-lite'; import { createPopper, offsetModifier } from '@vant/popperjs';
import offsetModifier from '@popperjs/core/lib/modifiers/offset';
import extendsHelper from '@babel/runtime/helpers/esm/extends';
import { createNamespace } from '../utils'; import { createNamespace } from '../utils';
import { BORDER_BOTTOM } from '../utils/constant'; import { BORDER_BOTTOM } from '../utils/constant';
@ -11,13 +9,6 @@ import { ClickOutsideMixin } from '../mixins/click-outside';
import Icon from '../icon'; import Icon from '../icon';
import Popup from '../popup'; import Popup from '../popup';
// add Object.assign polyfill for popper.js
// see: https://popper.js.org/docs/v2/browser-support/
/* istanbul ignore if */
if (!Object.assign) {
Object.assign = extendsHelper;
}
const [createComponent, bem] = createNamespace('popover'); const [createComponent, bem] = createNamespace('popover');
export default createComponent({ export default createComponent({

View File

@ -2107,6 +2107,13 @@
fast-glob "^3.2.2" fast-glob "^3.2.2"
fs-extra "^9.0.0" fs-extra "^9.0.0"
"@vant/popperjs@^1.0.0":
version "1.0.0"
resolved "https://registry.npmjs.org/@vant/popperjs/-/popperjs-1.0.0.tgz#2d66ab4b8e275c98fb82f5efd43fdd47964d11f2"
integrity sha512-2OAl3URmH37OOATcKuT8iuZozoZVNMc8iLLZvurWZqHlWlAojsDHm7lQ2OKlAV4jlxbiFJt0en6DY+WlxHvN9w==
dependencies:
"@popperjs/core" "^2.5.4"
"@vant/stylelint-config@^1.3.0": "@vant/stylelint-config@^1.3.0":
version "1.3.0" version "1.3.0"
resolved "https://registry.yarnpkg.com/@vant/stylelint-config/-/stylelint-config-1.3.0.tgz#702cb87a8698185904aea56ada967064e6821aa4" resolved "https://registry.yarnpkg.com/@vant/stylelint-config/-/stylelint-config-1.3.0.tgz#702cb87a8698185904aea56ada967064e6821aa4"