这段时间一直在学习开发vue项目,就利用空余时间开发了个vue版仿微信界面聊天室。
使用了vue2.0+vuex+vue-cli+vue-router+webpack+wcpop等技术构建开发,基本实现了微信聊天功能,还实现了vue登录验证拦截。
vue聊天核心代码片段:
// >>> 【表情、动图swiper切换模块】--------------------------
var emotionSwiper;
function setEmotionSwiper(tmpl) {
var _tmpl = tmpl ? tmpl : $("#J__emotionFootTab ul li.cur").attr("tmpl");
$("#J__swiperEmotion .swiper-container").attr("id", _tmpl);
$("#J__swiperEmotion .swiper-wrapper").html($("." + _tmpl).html());
emotionSwiper = new Swiper('#' + _tmpl, {
// loop: true,
// autoplay: true,
// 分页器
pagination: {
el: '.pagination-emotion', clickable: true,