be-fe / be-fe/iSlider

问题锦集【收集iSlider使用过程中的一些问题和解决方法】

Open
#424 0 comments 2 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
1.6k
Forks
441
PR merge metrics
No merged PRs in 30d

Description

- 1.点击事件无效,[参考](http://blog.csdn.net/qingchen1016/article/details/51545868)
配置选项设置 `fixPage:false // 不阻止原生事件`,这样就可以给slider中的dom添加事件了。ps: 我自己尝试了一下,使用delagate方法,结果
````
mySlider.on('click', '.slider-img', function(){
console.log(arguments);
})
````
arguments第一个参数返回的是`.slider-img`选择器的dom元素,第二个是callee,第三个是一个回调。说好的,第一个是传回的是event对象呢?
- 2.vue中使用iSlider,只好把vue当成一个ui渲染组件,然后取出html,放到data中,拼成符合islider api的数据。
````
let banners = [];
const vm = new Vue({
template: ``,
data: { item: item }
}).$mount();

banners.push({
content: vm.$el
});
````
由于使用了template,所以需要设置一个vue别名,指向dist/vue.min.js
````
resolve: {
alias: {
vue: 'vue/dist/vue.min.js'
}
}
````

- 3.[pc上的兼容优化](http://www.cnblogs.com/qiny-easyui/p/5708556.html)
还没开始看源码,所以不予评价,放到这里mark一下

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing the three cases recorded in this issue: the fixPage:false click behavior, the Vue template and vue alias example, and the linked desktop compatibility note. Confirm which guidance remains valid and define the documentation scope before making changes; done means the relevant iSlider usage advice is organized and verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
documentation, frontend
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.