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- ...
随机推荐
- 记一次奇葩事——html5可能不支持window.onscroll函数
只在html5里遇到,html4没事:拿出来聊聊,路过帮忙解答下!!! 不正常的 <!doctype html><html><head><meta chars ...
- How to parse version range
Now we are making a solution that has to get the package reference. But the version of package refer ...
- 将 using namespace 写在函数体中,以避免命名空间冲突
将 using namespace xxx 写在函数体中时, 命名空间 xxx 中定义的资源只在该函数体中有效. 测试代码如下图所示(namespace std 只在函数 testFun2 中有效):
- linux c函数参考手册
一.字符测试 isalnum(测试字符是否为英文字母或数字) isalpha(测试字符是否为英文字母) isascii(测试字符是否为ascii码字符) isblank(测试字符是否为空格字符) is ...
- Django 中配置MySQL数据库
在Django的项目中会默认使用sqlite的数据库 配置MySQL需要在setting.py 里加入以下设置: 配置数据库 DATABASES = { 'default': { 'ENGINE': ...
- 别怕,"卷积"其实很简单(下)
文章来自我的CSDN同名博客,欢迎文末扫码关注~ 定义 基于上一篇文章的通俗化例子,我们从基本概念上了解了卷积,那么更严格的定义是怎样的呢? 从数学上讲,卷积只不过是一种运算,对于很多没有 ...
- TVP访谈 | 贝壳金服史海峰:中台虽百家争鸣,但不是所有企业必需品
导语 | 中台作为一个技术概念,曾一度被捧得火热.那么,中台现在发展到了什么阶段呢?对于所有企业来讲,中台都是普适的么?中台在具体的落地过程中,究竟存在哪些问题呢?腾讯云最具价值专家(TVP)史海峰, ...
- $vjudge\ CSP-S$专题专练题解
照例先放个链接$QwQ$ $A$ $QwQ$之前写过题解辣. 重新说下趴,就给横坐标纵坐标也开点,然后每个点连向对应横纵坐标边权为$0$,相邻横坐标点之间连边,相邻纵坐标点之间连边,跑个最短路就完事$ ...
- $loj\ 2031\ [SDOI2016]$数字配对 网络流
正解:网络流 解题报告: 我永远喜欢$loj$! 显然先预处理哪些$a$之间可以连边,然后考虑建两排点,连流量为$c_{i}\cdot c_{j}$,然后$ST$连$inf$,跑个费用流? 然后现在碰 ...
- 「洛谷P2906」[USACO08OPEN]牛的街区Cow Neighborhoods 解题报告
P2906 [USACO08OPEN]牛的街区Cow Neighborhoods 题目描述 Those Who Know About Cows are aware of the way cows gr ...