提交 7cd60733 编写于 作者: DCloud_JSON's avatar DCloud_JSON

修复 示例项目 drop-card 关闭后重新打开,会出现卡片高度错误的问题

上级 a646a327
...@@ -14,8 +14,7 @@ ...@@ -14,8 +14,7 @@
<script lang="ts"> <script lang="ts">
let sX : number = 0, let sX : number = 0,
sY : number = 0, sY : number = 0,
screenWidth : number = 1, screenWidth : number = 1;
nodesMap = new Map<string, INode[]>();
export default { export default {
data() { data() {
...@@ -27,9 +26,9 @@ ...@@ -27,9 +26,9 @@
'/static/template/drop-card/2.jpg', '/static/template/drop-card/2.jpg',
'/static/template/drop-card/3.jpg' '/static/template/drop-card/3.jpg'
] as string[], ] as string[],
NodesMap: new Map<string, INode[]>(),
// 页码 // 页码
currentIndex:0 as number currentIndex:0 as number,
$nodesMap:new Map<string, INode[]>()
} }
}, },
onReady() { onReady() {
...@@ -63,10 +62,10 @@ ...@@ -63,10 +62,10 @@
methods: { methods: {
// 工具方法,用于快速设置 INode 的 style // 工具方法,用于快速设置 INode 的 style
setINodeStyle(refName:string,index:number,propertyName:string,propertyStyle:any):void{ setINodeStyle(refName:string,index:number,propertyName:string,propertyStyle:any):void{
let nodes:INode[]|null = nodesMap.get(refName) let nodes:INode[]|null = this.$nodesMap.get(refName)
if(nodes == null){ if(nodes == null){
nodes = this.$refs.get(refName) as INode[] nodes = this.$refs.get(refName) as INode[]
nodesMap.set(refName,nodes) this.$nodesMap.set(refName,nodes)
}else{ }else{
// console.log('直接拿'); // console.log('直接拿');
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册