如何为 Polymer 3.x 导入 <paper-textarea>?
How to import <paper-textarea> for Polymer 3.x?
我尝试了以下终端命令:
npm install --save paper-input
然后得到以下错误:
该错误消息中的关键语句是
npm WARN paper-input@3.0.2 requires a peer of react@>= 15.0.0 but none is installed. You must install peer dependencies yourself.
另外,好像是把repo存入了
node_modules > 纸张输入(如 2.x 元素)
而不是:
node_modules > @polymer > paper-input(像 3.x 元素应该)
这是怎么回事?我只想安装 paper-input
.
Will the following work?
npm install --save paper-input
不,那个 paper-input
package is actually for React. The Polymer package is @polymer/paper-input
,所以你 运行:
npm install --save @polymer/paper-input
并且您的导入用法确实正确(参见 demo)。
I don't see a v3 element for paper-input
我假设您正在查看 paper-input
's GitHub releases, which does not include any versions newer than v2.2.3. However, there are in fact newer versions in NPM, but they're not tagged in GitHub for some reason. The element version compatible with Polymer 3.x is 3.0.0-pre.21
。
我尝试了以下终端命令:
npm install --save paper-input
然后得到以下错误:
该错误消息中的关键语句是
npm WARN paper-input@3.0.2 requires a peer of react@>= 15.0.0 but none is installed. You must install peer dependencies yourself.
另外,好像是把repo存入了
node_modules > 纸张输入(如 2.x 元素)
而不是:
node_modules > @polymer > paper-input(像 3.x 元素应该)
这是怎么回事?我只想安装 paper-input
.
Will the following work?
npm install --save paper-input
不,那个 paper-input
package is actually for React. The Polymer package is @polymer/paper-input
,所以你 运行:
npm install --save @polymer/paper-input
并且您的导入用法确实正确(参见 demo)。
I don't see a v3 element for
paper-input
我假设您正在查看 paper-input
's GitHub releases, which does not include any versions newer than v2.2.3. However, there are in fact newer versions in NPM, but they're not tagged in GitHub for some reason. The element version compatible with Polymer 3.x is 3.0.0-pre.21
。