Remove html tags in rich text and filters in vue, react and wechat applets
After getting the rich text, as long as part of the content is displayed, the rich text label needs to be removed, and then part of the content needs to be intercepted; then the filter, which has been used many times in wechat applets, has also been encountered in vue and react
1. Remove html tags from rich text
Remove html tags and spaces
let ...
Posted by gabo on Sun, 08 Dec 2019 05:23:18 -0800
Define your own chart echart component based on vue2
First install the echarts cnpm i echarts -S, and then define the parent component
<template>
<div>
<echarts :option="echartOpion"></echarts>
</div>
</template>
<script>
import echarts from './echarts.vue' // Introduce subcomponents
export default {
data() {
return ...
Posted by keyurjbhatt on Sat, 07 Dec 2019 23:57:48 -0800
vue-day2 of front end and mobile development
Global filter
// Define a global filter
Vue.filter('dataFormat', function (input, pattern = '') {
var dt = new Date(input);
// Date of acquisition
var y = dt.getFullYear();
var m = (dt.getMonth() + 1).toString().padStart(2, '0');
var d = dt.getDate().toString().padStart(2, '0');
// If the string type passed in is equal to yy ...
Posted by xjake88x on Sat, 07 Dec 2019 22:16:08 -0800
git server setup and code check
For local git service, gitlab is usually selected. I first chose gitlab and installed it on centos7 according to the steps on the official website. The download speed was unbearable and I had no choice but to give up. Finally, choose to install gogs image in docker to build git service.
I. installation of gogs
1. Pull image
docker pull gogs/ ...
Posted by glennn3 on Sat, 07 Dec 2019 17:30:54 -0800
Using central event bus in vue
In vue, props is used to transfer values from the parent component to the child component, and event bus can be used to transfer values between non parent and child components, or vuex can be used to see the following event bus examples.
Code on, as follows:
1,vue-bus.js
List-1 vue-bus.js
const install = function (Vue) {
const Bus = ...
Posted by lli2k5 on Sat, 07 Dec 2019 13:33:09 -0800
Talk about the functional functional components in Vue.js
The Vue.js component provides a functional switch. When set to true, the component can become a stateless and instance free functional component. Because it's just a function, rendering costs are relatively small.
The Render function in the functional component provides the second parameter context as the context. data, prop ...
Posted by goldages05 on Sat, 07 Dec 2019 07:16:46 -0800
How to judge whether the page is pc or mobile and enter different pages
vue judges whether pc or mobile end enters different pages respectively
The mobile terminal code is determined as follows:
function IsPC(){
var userAgentInfo = navigator.userAgent;
var Agents = new Array("Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod");
var flag = true;
for (var v = 0; v < Agents. ...
Posted by neuro4848 on Fri, 06 Dec 2019 16:02:03 -0800
Use of recursive components raised by a case of Vue
Today, we continue to use Vue's "roll up our actual combat project". Only in the actual combat can we understand more. Just talk about the war and get the eggs. Continue our Summary of binding dynamic components and global events triggered by a case of Vue After that, let's talk about how we use recursive components in our projects.
C ...
Posted by wiccanwoman1103 on Fri, 06 Dec 2019 15:00:29 -0800
VUE parent-child components transfer data
1. Transfer data synchronously
The parent component food passes the type field with a value of 0 to the child component through props. When the child component initializes, it can get the type field and render the character "0 fruit"
// Parent component food.vue
<template>
<apple :type="type"></apple>
</template ...
Posted by mady on Fri, 06 Dec 2019 11:50:34 -0800
Element input box with history query record
Requirement description
Add the query box on the page to display the history search record
Realization and pit record
Use the Element input box with input suggestions to achieve this requirement. Usage details Official website
1. Pit 1: cannot return array directly in querySearch, must call callback function cb to process data
Take a look at t ...
Posted by Concat on Fri, 06 Dec 2019 00:26:58 -0800