diff --git a/config/config.ts b/config/config.ts index 401e30b00..70a5ffed7 100644 --- a/config/config.ts +++ b/config/config.ts @@ -32,6 +32,15 @@ export default { j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-WWGN4HC'); + `, + ` + if(window.location.pathname==='/components/icon'){ + window.addEventListener('message', async (e) => { + if(e.data.iconType) { + await navigator.clipboard.writeText(e.data.iconType); + } + }) + } ` ], styles: [` diff --git a/demo/pages/Icon/index.acss b/demo/pages/Icon/index.acss index 0c0d4624f..ce438b37d 100644 --- a/demo/pages/Icon/index.acss +++ b/demo/pages/Icon/index.acss @@ -5,21 +5,25 @@ .sum { padding: 24rpx; } -.sum > text { + +.sum>text { color: red; } + .list-title { color: red; font-size: 32rpx; font-weight: bold; padding: 24rpx; } + .icon-list { display: flex; flex-wrap: wrap; padding: 24rpx; background: #fff; } + .icon-item { display: flex; flex-direction: row; @@ -41,3 +45,11 @@ word-wrap: break-word; word-break: break-all; } + +.icon-item-wrapper { + display: flex; + flex-direction: row; + align-items: flex-start; + justify-content: center; + flex-wrap: wrap; +} diff --git a/demo/pages/Icon/index.axml b/demo/pages/Icon/index.axml index 32a3db898..31ff80795 100644 --- a/demo/pages/Icon/index.axml +++ b/demo/pages/Icon/index.axml @@ -1,15 +1,18 @@ - 目前共有{{iconTypes.length}}个图标类型 + 目前共有 + {{iconTypes.length}}个图标类型 线框风格 - - {{item}} + + + {{item}} + @@ -17,8 +20,10 @@ - - {{item}} + + + {{item}} + diff --git a/demo/pages/Icon/index.js b/demo/pages/Icon/index.js index e556a5bf5..40270f5c2 100644 --- a/demo/pages/Icon/index.js +++ b/demo/pages/Icon/index.js @@ -160,8 +160,12 @@ Page({ this.setData({ searchValue: value }); }, handleClickIcon(e) { + const { info } = e.target.dataset; + + top.postMessage({ iconType: info }, '*'); + my.showToast({ - content: `click ${e.currentTarget.dataset.info}`, + content: `${info} 已复制到剪贴板`, }); }, });