https://github.com/binbiubiubiu/pt-grid
拼图 (miniapp component for taobao)
https://github.com/binbiubiubiu/pt-grid
component miniapp-component miniprogram pintu pt-grid tao-bao taobao
Last synced: 3 months ago
JSON representation
拼图 (miniapp component for taobao)
- Host: GitHub
- URL: https://github.com/binbiubiubiu/pt-grid
- Owner: Binbiubiubiu
- License: mit
- Created: 2020-03-29T04:52:22.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-04-09T13:34:55.000Z (6 months ago)
- Last Synced: 2025-06-19T00:11:58.713Z (4 months ago)
- Topics: component, miniapp-component, miniprogram, pintu, pt-grid, tao-bao, taobao
- Language: JavaScript
- Homepage:
- Size: 968 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pt-grid
miniapp component for taobao
## 安装
```sh
# npm
npm install pt-grid# yarn
yarn add pt-grid
```## 示例
## 代码片段
##### example.axml
```vue
```
##### example.js
```JS
Page({
data: {
level:3,
backgroundImage:"http://p4.music.126.net/qX3ID48PhpAiDIt-VqlNkw==/109951163524169951.jpg",
width:300,
height:300
},
pintuRef(ref) {
// 存储自定义组件实例,方便以后调用
this.pintu = ref;
},
onGameOver() {
let _self =this;
my.confirm({
title: '温馨提示',
content: '游戏结束',
confirmButtonText: '再来一次',
cancelButtonText: '太简单了',
success: (result) => {
result.confirm && _self.pintu.initGame(_self.data.level);
},
});
}});
```
##### example.json
```json
{
"usingComponents": {
"pintu": "pt-grid/es/index"
}
}
```## 属性
| 名称 | 类型 | 描述 | 默认值 |
| --------------- | -------------- | :----------------------- | -------- |
| level | number | 难度(网格数) | 3 |
| width | 宽度 | 宽度 | 300 |
| height | string\|number | 高度 | 300 |
| backgroundImage | string | 背景图片(最好宽高相等) | “” |
| onGameOver | function | 游戏结束回调 | ()=>void |