render()到底渲染的什么?
1、格式
render(request,"xx.html",{"xx": xx})
2、本质
通过模板语言动态渲染字符串(HTML文件)
注意:
1、HTML文件可以直接使用模板语言的变量
2、JS不能直接使用模板语言的变量,就像python不能直接使用变量名一样
解决方案
HTML文件
<p class="info hide" name="{article_list.username}"></p>
JS文件
var username = $(".info").attr(name)
render()到底渲染的什么?的更多相关文章
- render 函数渲染表格的当前数据列使用
columns7: [ { title: '编号', align: 'center', width: 90, key: 'No', render: (h, params) => { return ...
- 使用render函数渲染组件
使用render函数渲染组件:https://www.jianshu.com/p/27ec4467a66b
- render方法渲染组件和在webpack中导入vue
使用component注册的组件div容器里可以放多个,但是使用render的只能放一个 <div id="app"> <p>我可以放两个</p> ...
- 用ActionController::Renderer的render方法渲染模版
使用Cable进行pub: ActionCable.server.broadcast "call", {address: AddressesController.render(@a ...
- 实例的render方法渲染组件
1.普通渲染组件 在app容器中插入login组件 <login></login> 一个app可以多个这种组件 <script> var login = { te ...
- 010 vue使用render方法渲染组件
1.普通的组件渲染方式 <!DOCTYPE html> <html lang="en"> <head> <meta charset=&qu ...
- 19 使用Vue实例的render方法渲染组件
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- 在vue中结合render函数渲染指定的组件到容器中
1.demo 项目结构: index.html <!DOCTYPE html> <html> <head> <title>标题</title> ...
- react之异步请求数据,render先行渲染报错,未拿到数据
import React from 'react' import {connect} from 'react-redux' import { Redirect} from 'react-router- ...
随机推荐
- java用普通类如何实现枚举功能
用普通类如何实现枚举功能,定义一个Weekday的类来模拟枚举功能. 1.私有的构造方法. 2.每个元素分别用一个公有的静态成员变量表示. 可以有若干公有方法或抽象方法.采用 ...
- 51nod 1281山峰和旗子
1281 山峰和旗子 题目来源: Codility 基准时间限制:1 秒 空间限制:131072 KB 分值: 40 难度:4级算法题 用一个长度为N的整数数组A,描述山峰和山谷的高度.山峰需要满足 ...
- H3C保存当前配置--用户图示(console)以上
<H3C>save //此种保存只默认保存为Startup.cfg ,系统默认是加载此文件 The current configuration will be writte ...
- Spring、Spring Boot和TestNG测试指南 - 使用Spring Boot Testing工具
Github地址 前面一个部分讲解了如何使用Spring Testing工具来测试Spring项目,现在我们讲解如何使用Spring Boot Testing工具来测试Spring Boot项目. 在 ...
- <% %>、<%! %>和<%= %>
<% %> 此标签内的内容在jsp编译的时候,将被编译成servlet的_jspService()方法.这个方法用作服务器端向客户端输出.因此这对标签里边不能在定义方法了,因为在Java ...
- VIM 用正则表达式,非贪婪匹配,匹配竖杠,竖线, 匹配中文,中文正则,倒数第二列, 匹配任意一个字符 :
VIM 用正则表达式 批量替换文本,多行删除,复制,移动 在VIM中 用正则表达式 批量替换文本,多行删除,复制,移动 :n1,n2 m n3 移动n1-n2行(包括n1,n2)到n3行之下: ...
- Python之time模块和datatime模块
import time time.sleep(5) #休眠 time.time() #返回系统时间戳 utc时间秒数 time.ctime() #返回字符串时间格式,也可以传入参数转换为字符串时间ti ...
- 小白学 Python 爬虫(30):代理基础
人生苦短,我用 Python 前文传送门: 小白学 Python 爬虫(1):开篇 小白学 Python 爬虫(2):前置准备(一)基本类库的安装 小白学 Python 爬虫(3):前置准备(二)Li ...
- MYSQL调优实战
一:基础数据准备 DROP TABLE IF EXISTS `tbl_user`; CREATE TABLE `tbl_user` ( `id` ) NOT NULL AUTO_INCREMENT, ...
- shell脚本查找tcp过多ip地址封掉
#!/bin/bash #hc source /etc/profile iplist=`netstat -ntu | awk '{print $5}'| cut -d':' -f1| sort |un ...