![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
vue
qq_33221699
这个作者很懒,什么都没留下…
展开
-
中文拼音排序
['张三','李四','啊','王五'].sort((a, b) => a.localeCompare(b, 'zh-Hans-CN', {sensitivity: 'accent'}))//打印:(4)["啊", "李四", "王五", "张三"]原创 2019-06-01 15:36:02 · 475 阅读 · 0 评论 -
监听网络状态
<template> <div> <div class="tab"> <div class="hd"> <span v-bind:class="{cur:lanmu=='xinwen'}" v-on:click="change('xinwen')">新闻</span> <span v-...原创 2019-08-08 17:39:50 · 246 阅读 · 0 评论 -
websocket重连机制(心跳重连)
心跳重连(网络断开连接后,需要重连)var WebSocket = {};WebSocket.init = function(uri) { this.wsUri = uri; this.lastHeartBeat = new Date().getTime(); this.overtime = 8000; initChannelData(); ...原创 2019-08-19 17:05:14 · 531 阅读 · 0 评论 -
vue 基本操作
1.图片地址切换:效果图:代码:<div :class="{ActiveHash:is_hash}"> <img :src="require(`@/assets/img/txt_hxkj_${a = is_hash?'xz':'zc'}.png`)" alt="" @click="is_hash...原创 2019-09-02 18:12:15 · 137 阅读 · 0 评论