This repository has been archived on 2023-08-30. You can view files and clone it, but cannot push or open issues/pull-requests.
bytedo
/
wcui
Archived
1
0
Fork 0

修改样式由:attr指令改为:css

old
lcoln 2017-09-26 00:24:31 +08:00
parent a597117368
commit e055c2f089
2 changed files with 5 additions and 6 deletions

View File

@ -4,14 +4,13 @@
<div class="container"> <div class="container">
<div class="box" <div class="box"
:attr="{style: 'width:' + sliderList.length * 100 + '%;' + transform}"> :css="{width: sliderList.length * 100 + '%', transform: transform}">
<a target="_blank" <a target="_blank"
:repeat="sliderList" :repeat="sliderList"
:css="{width: currWidth}" :css="{width: currWidth}"
:attr="{href: el.link || 'javascript:;'}"> :attr="{href: el.link || 'javascript:;'}">
<img :attr-src="el.src"> <img :attr-src="el.src">
<p :if="el.title" <p :if="el.title"
:attr="{style: el.titlaStyle ? el.titleStyle + ';' : ''}"
:html="el.title" :html="el.title"
class="default-class"></p> class="default-class"></p>
</a> </a>

View File

@ -95,7 +95,7 @@ define(["yua", "text!./main.htm", "css!./main"], function(yua, tpl){
if(vm.currWidth.indexOf('px') > -1) if(vm.currWidth.indexOf('px') > -1)
width = vm.currWidth.slice(0, vm.currWidth.indexOf('px')) width = vm.currWidth.slice(0, vm.currWidth.indexOf('px'))
vm.transform = 'transform: translate(' + (-width * val) + 'px, 0);' vm.transform = 'translate(' + (-width * val) + 'px, 0)'
if(vm.preview) if(vm.preview)
vm.sliderBtnList = getBtnList(vm) vm.sliderBtnList = getBtnList(vm)
}) })
@ -106,7 +106,7 @@ define(["yua", "text!./main.htm", "css!./main"], function(yua, tpl){
if(vm.currWidth.indexOf('px') > -1) if(vm.currWidth.indexOf('px') > -1)
width = vm.currWidth.slice(0, vm.currWidth.indexOf('px')) width = vm.currWidth.slice(0, vm.currWidth.indexOf('px'))
vm.transform = 'transform: translate(' + (-width * vm.curr) + 'px, 0);' vm.transform = 'translate(' + (-width * vm.curr) + 'px, 0)'
if(vm.preview) if(vm.preview)
vm.sliderBtnList = getBtnList(vm) vm.sliderBtnList = getBtnList(vm)
}, false) }, false)
@ -125,8 +125,8 @@ define(["yua", "text!./main.htm", "css!./main"], function(yua, tpl){
transform: '', transform: '',
curr: 0, curr: 0,
sliderBtnList: [], sliderBtnList: [],
maxNum: '', maxNum: 0,
auto: '', auto: yua.noop,
sliderList: [], sliderList: [],
autoSlide: '', autoSlide: '',