encodeURIComponent()加密、decodeURIComponent()解码及v-html将字符串转换为html
1)新闻详情页后台给我的数据是加密之后的,我问了后台,是用encodeURIComponent()加密的,然后我就用对应的方法decodeURIComponent()解密:
this.$store.state.news.main =decodeURIComponent(data.FormattedBody);
2) 然后{{this.$store.state.news.main}}这样填数据,等我看页面的时候,页面上出现了一串字符串,然后我就想起了v-html,
<div v-html="this.$store.state.news.main">
{{this.$store.state.news.main}}
</div>
注意:v-html的引号里面的内容要和{{}}的内容是一样的,这样,页面就正常显示了
encodeURIComponent()加密、decodeURIComponent()解码及v-html将字符串转换为html的更多相关文章
- 浏览器URL中 encodeURIComponent()加密和decodeURIComponent()解码
encodeURIComponent()加密 定义和用法 encodeURIComponent() 函数可把字符串作为 URI 组件进行编码. 语法 encodeURIComponent(URIstr ...
- JS中encodeURI()、decodeURI()、encodeURIComponent()和decodeURIComponent()编码与解码
编码解码问题. 解决这个问题大家一般都使用encodeURI或者encodeURIComponent方法,在这里做一下总结: 首先看看各个方法不同浏览器的支持程度 函数 描述 FF N IE deco ...
- 【转】URL编码(encodeURIComponent和decodeURIComponent)
转自http://blog.jhonse.com/archives/2032.jhonse 最近在用CI框架的时候,发现一个问题,URL的GET方式链接时,如果用中文字符的话,就会出现问题,提示:链接 ...
- JS escape、encodeURI 、encodeURIComponent 编码与解码[转]
转至:http://jc-dreaming.iteye.com/blog/1702407 本文讨论如何对传递参数用JS编码与解码 1:编码与解码方法的对应关系 escape ------------- ...
- URI 方法 encodeURI() encodeURIComponent() docodeURI() decodeURIComponent()
URI 方法 encodeURI() encodeURIComponent() docodeURI() decodeURIComponent() var sUri = “http://ww ...
- (译)利用ASP.NET加密和解密Web.config中连接字符串
介绍 这篇文章我将介绍如何利用ASP.NET来加密和解密Web.config中连接字符串 背景描述 在以前的博客中,我写了许多关于介绍 Asp.net, Gridview, SQL Server, A ...
- 利用ASP.NET加密和解密Web.config中连接字符串
摘自:博客园 介绍 这篇文章我将介绍如何利用ASP.NET来加密和解密Web.config中连接字符串 背景描述 在以前的博客中,我写了许多关于介绍 Asp.net, Gridview, SQL Se ...
- decodeURIComponent 解码函数
想象一个场景,你朋友发一个链接让你打开,但链接是下面其中之一,你会不会想锤死他 1. \u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0062\u0069\u0 ...
- encodeURIComponent编码与解码
问题:JavaScript用encodeURIComponentt编码后无法再后台解码的问题. 目前写法: window.self.location="list.jsp?searchtext ...
随机推荐
- 5G的科普
5G的科普 1. 通信起源公式 2. 5G在有线与无线的应用 主要在无线上的突破 因为有线也就是(电缆,光纤,双绞线)这些传输介质,特别是光纤,以及完全达到我们平时通信所需求的速率 那么瓶颈在哪?短板 ...
- 关于R文件
1 什么是R文件 R文件是自动生成的文件,里面保存的是res目录下所有资源的ID. 2 如何使用 2.1 在java代码中使用 txtName = (TextView)findViewById(R.i ...
- Java——LinkedList使用Demo
package list; import java.util.Iterator; import java.util.LinkedList; public class LinkedListDemo { ...
- 极*Java速成教程 - (7)
Java高级特性 数组 在Java中,数组是一串连续的,不可改变长度的,对象被固定的,类型固定的连续空间.数组中的随机访问非常迅速,但为了速度放弃了灵活性.而效率也是数组最大的优点. 在使用泛型的容器 ...
- getchar返回int类型
#include <stdio.h> /* copy input to output; 2nd version */main(){int c;c = getchar();while(c ! ...
- 18: vue-element-admin使用
1.1 vue-element-admin使用 1.使用参考网站 1)官方演示环境: https://panjiachen.github.io/vue-element-admin/#/dashboar ...
- Django之AJAX请求
---恢复内容开始--- 一.choices字段 1.实列 前端代码 <div class='container'> <div class="row"> ...
- flockfile, ftrylockfile, funlockfile - 为标准输入输出锁定文件 FILE
SYNOPSIS 总览 #include <stdio.h> void flockfile(FILE *filehandle); int ftrylockfile(FILE *fileha ...
- 利用描述符自定义property
class Lazyproperty: def __init__(self,func): #传的func函数是被描述的类中的函数属性 self.func = func def __get__(self ...
- 【转】/etc/inittab文件详解
转自:https://www.cnblogs.com/ricks/p/10020886.html Linux在完成核内引导(已经被载入内存,开始运行,并已初始化所有的设备驱动程序和数据结构等)之后,就 ...