update readme
This commit is contained in:
parent
3a7c46c2d3
commit
e049bd1334
Binary file not shown.
After Width: | Height: | Size: 213 KiB |
|
@ -194,4 +194,21 @@ Page({
|
|||
|
||||
这就完了?远没有,看 cax 在小程序中的这个例子:
|
||||
|
||||
![](https://github.com/Tencent/omi/blob/master/assets/cax.gif)
|
||||
![](https://github.com/Tencent/omi/blob/master/assets/cax.gif)
|
||||
|
||||
详细代码:
|
||||
|
||||
```js
|
||||
renderSVG(html`
|
||||
<svg width="300" height="200">
|
||||
<path d="M 256,213 C 245,181 206,187 234,262 147,181 169,71.2 233,18 220,56 235,81 283,88 285,78.7 286,69.3 288,60 289,61.3 290,62.7 291,64 291,64 297,63 300,63 303,63 309,64 309,64 310,62.7 311,61.3 312,60 314,69.3 315,78.7 317,88 365,82 380,56 367,18 431,71 453,181 366,262 394,187 356,181 344,213 328,185 309,184 300,284 291,184 272,185 256,213 Z" style="stroke:#ff0000; fill: black">
|
||||
<animate dur="32s" repeatCount="indefinite" attributeName="d" values="......太长,这里省略 paths........" />
|
||||
</path>
|
||||
</svg>`, 'svg-c', this)
|
||||
```
|
||||
|
||||
再试试著名的 SVG 老虎:
|
||||
|
||||
<img src="https://github.com/Tencent/omi/blob/master/assets/tiger.jpg" width="700" />
|
||||
|
||||
path 太长,就不贴代码了,可以[点击这里查看](https://github.com/Tencent/omi/blob/master/packages/cax/pages/tiger/index.js)
|
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
"pages": [
|
||||
"pages/tiger/index",
|
||||
"pages/transformation/index",
|
||||
"pages/animate/index",
|
||||
"pages/batman/index",
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"usingComponents": {
|
||||
"cax-element":"../../cax/index"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
<!--index.wxml-->
|
||||
<view class="container">
|
||||
<cax-element id="svg-a"></cax-element>
|
||||
</view>
|
|
@ -0,0 +1,21 @@
|
|||
/**index.wxss**/
|
||||
.userinfo {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.userinfo-avatar {
|
||||
width: 128rpx;
|
||||
height: 128rpx;
|
||||
margin: 20rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.userinfo-nickname {
|
||||
color: #aaa;
|
||||
}
|
||||
|
||||
.usermotto {
|
||||
margin-top: 200px;
|
||||
}
|
Loading…
Reference in New Issue