From f3ad7ed1a77cd2f19001489ea64df0d61429ce33 Mon Sep 17 00:00:00 2001 From: chenjiahan Date: Wed, 25 Nov 2020 21:50:55 +0800 Subject: [PATCH] fix(Popover): failed to compile --- package.json | 1 + packages/vant-popperjs/package.json | 3 ++- src/popover/index.js | 11 +---------- yarn.lock | 7 +++++++ 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 69e3095ee..01bfca72b 100644 --- a/package.json +++ b/package.json @@ -55,6 +55,7 @@ "dependencies": { "@babel/runtime": "7.x", "@vant/icons": "1.4.0", + "@vant/popperjs": "^1.0.0", "@vue/babel-helper-vue-jsx-merge-props": "^1.0.0", "vue-lazyload": "1.2.3" }, diff --git a/packages/vant-popperjs/package.json b/packages/vant-popperjs/package.json index 79c349bff..5731c7d3c 100644 --- a/packages/vant-popperjs/package.json +++ b/packages/vant-popperjs/package.json @@ -5,7 +5,8 @@ "main": "lib/index.js", "types": "lib/index.d.ts", "publishConfig": { - "access": "public" + "access": "public", + "registry": "https://registry.npmjs.org/" }, "scripts": { "dev": "rollup --config rollup.config.js --watch", diff --git a/src/popover/index.js b/src/popover/index.js index c66c52bab..087964b38 100644 --- a/src/popover/index.js +++ b/src/popover/index.js @@ -1,6 +1,4 @@ -import { createPopper } from '@popperjs/core/lib/popper-lite'; -import offsetModifier from '@popperjs/core/lib/modifiers/offset'; -import extendsHelper from '@babel/runtime/helpers/esm/extends'; +import { createPopper, offsetModifier } from '@vant/popperjs'; import { createNamespace } from '../utils'; import { BORDER_BOTTOM } from '../utils/constant'; @@ -11,13 +9,6 @@ import { ClickOutsideMixin } from '../mixins/click-outside'; import Icon from '../icon'; 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'); export default createComponent({ diff --git a/yarn.lock b/yarn.lock index 891acde56..95a1ef703 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2107,6 +2107,13 @@ fast-glob "^3.2.2" 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": version "1.3.0" resolved "https://registry.yarnpkg.com/@vant/stylelint-config/-/stylelint-config-1.3.0.tgz#702cb87a8698185904aea56ada967064e6821aa4"