option里綁定表單的id.
選擇后通過表單id獲取表單
然后表單提交
< img src="ftp://username:password@192.168.0.1:21/11/xx.jpg">
你也沒說你遇到什么問題了啊
之前瞎說了一波.....ejs
渲染以后不能動(dòng)態(tài)修改,還是要靠ajax
...根據(jù)你的代碼改了一下,上代碼,代碼測過了沒問題,圖我就不放了,你可以自己測一下。
ejs
中:
<div class="portlet-body" id="container">
<div class="table-scrollable">
<table class="table table-hover" id="headerTable">
<thead>
<tr>
<th>序號(hào)</th>
<th>姓名</th>
<th>狀態(tài)</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<% orders.forEach(function (order) { %>
<td><%= order.id %></td>
<td><%= order.empname %></td>
<% if(order.status ==1) { %> <td>已提交</td> <% } else { %> <td>已通過</td> <% } %>
<td><button>通過</button></td>
<% }) %>
</tbody>
</table>
</div>
<button id="ajax">ajax請(qǐng)求</button>
</div>
Node.js
控制器中:
et orders = [
{
id: 1,
empname: '測試一',
status: 1
}
]
let orders2 = [
{
id: 1,
empname: '測試一',
status: 1
},
{
id: 2,
empname: '測試二',
status: 2
}
]
app.get('/test', (req, res, next) => {
res.render('test', {
title: '測試',
orders
})
})
app.get('/test/get', (req, res, next) => {
res.send({
status: 1,
orders: orders2
})
})
Ajax
:
$('#ajax').click(function () {
$.ajax({
type: 'GET',
url: 'test/get',
success: function(res) {
if (res.status === 1) {
var str = '', tr = '', orders = res.orders;
for (var i = 0; i < orders.length ; i ++) {
str = '<td>' + orders[i].id + '</td>' + '<td>' + orders[i].empname + '</td>'
if (orders[i].status === 1) {
str += '<td>已提交</td><td><button>通過</button></td>'
} else {
str += '<td>已通過</td><td><button>通過</button></td>'
}
tr += '<tr>' + str + '</tr>'
}
$('#headerTable tbody').html(tr)
}
}
});
});
canvas用js動(dòng)畫庫畫的
1.vue里面有:class可以動(dòng)態(tài)綁定類,直接寫在v-for里面,將v-for循環(huán)的值作為:class的判斷添加;
2.下面貼上代碼html和js
<div v-for="(arrNumberList,index) in arrNumber"
:key='index'
:class="['common-number',{'arr-length-number':arrNumberList.numberOne.length==3}]">
{{arrNumberList.numberOne}}
</div>
data() {
return {
arrNumber:[
{numberOne:[1]},
{numberOne:[1,2,3]},
{numberOne:[1,2,3,4]},
]
};
},
3.希望能幫到你,圣誕節(jié)快樂噠
你的機(jī)器是多少位的? 我看官網(wǎng)上面是32位的,要是你機(jī)器是64位的,最好設(shè)置一下在兼容模式下運(yùn)行。
//JS將表單信息提交到不同的控制器
//seek為表單ID
function different(){
document.forms.seek.action="www.a.com";
document.forms.seek.submit();
document.forms.seek.action="www.b.com";
}
作者:pawn
鏈接:https://www.zhihu.com/questio...
來源:知乎
著作權(quán)歸作者所有。商業(yè)轉(zhuǎn)載請(qǐng)聯(lián)系作者獲得授權(quán),非商業(yè)轉(zhuǎn)載請(qǐng)注明出處。
在redux 內(nèi)部,有一個(gè) combineReducers 函數(shù),它會(huì)組合所有的子 reducer ,并返回最終的 reducer 。附上combineReducers 精簡版的源代碼function combineReducers(reducers) {
// 這兒返回的函數(shù)就是最終的reducer
return function (state, action) {
const keys = Object.keys(reducers)
const newState = {}
keys.forEach(key => {
newState[key] = reducers[key](state[key], action)
})
return newState
}
}
可以看到, 對(duì)于每一個(gè) dispatch, redux 內(nèi)部都會(huì)走所有的子 reducer 的。在題主的代碼中, default:
return { ...state, isFetching: false }
}
這句就會(huì)導(dǎo)致,不管發(fā)出什么dispatch, articles 的 isFetching 都會(huì)被置為false 。建議這里不要在 default: 中更改state,只返回state就好 。 reducer default 有2個(gè)用處初始化state , 在redux 內(nèi)部, 會(huì)執(zhí)行 state = dispatch({}) 來初始化state 。在combineReducers 后, 防止其它reducer 的dispatch 相互干擾 。以上 。
恩, 是的啦, 因?yàn)檫f歸的話可能是:
<parent>
<child>
<child>
<child>
</child>
</child>
</child>
</parent>
那么最里層的child的父組件本來就是倒數(shù)第二層的子組件~
懷疑你們的這幾個(gè)文件返回了
<html>
404
</html>
unionid 是每個(gè)小程序都有,這個(gè)是后端根據(jù)你提供的session-key 和openid 去獲取的。這么私密的unionid不會(huì)明目大膽的發(fā)出來給你,哪怕openid和appid你知道,你也不能寫死在程序里面面,這是一種非常不安全的方式,你需要你們后端給你通過第三方extconfig注入給你。這是后端的事,問題不在前端----
有沒有人能幫幫我呀?目前正在自己看cordova文檔,英文的看的好累,但還在看著。
因?yàn)槟隳弥思业拇翱诰浔税 ?openWin.close() 試試
Canvas
SVG
先附一段解決后的完整代碼
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<link rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
</head>
<body>
<div class="container">
<div class="row">
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><span class="glyphicon glyphicon-th-list"></span> MVVM</h3>
</div>
<div class="panel-body">
<!-- vm -->
<div id="vm">
<h3>{{ title }}</h3>
<ol>
<li v-for="todo in todos">
<dl>
<dt contenteditable="true" v-on:blur="update(todo, 'name', $event)">{{ todo.name }}</dt>
<dd contenteditable="true" v-on:blur="update(todo, 'description', $event)">{{ todo.description }}</dd>
<dd><a href="#0" v-on:click="remove(t)">Delete</a></dd>
</dl>
</li>
</ol>
</div>
<!-- vm -->
</div>
</div>
</div>
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><span class="glyphicon glyphicon-plus"></span> Add New Todo</h3>
</div>
<div class="panel-body">
<!-- vmAdd -->
<form id="vmAdd" action="#0">
<div class="form-group">
<label>Name:</label>
<input type="text" v-model="name" class="form-control" placeholder="Enter name">
</div>
<div class="form-group">
<label>Description:</label>
<input type="text" v-model="description" class="form-control" placeholder="Enter description">
</div>
<button type="submit" class="btn btn-default" v-on:click.prevent="submit">Add</button>
</form>
<!-- vmAdd -->
</div>
</div>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue@2.5.13/dist/vue.js"></script>
<script>
// 集成API
//https://www.liaoxuefeng.com/wiki/001434446689867b27157e896e74d51a89c25cc8b43bdb3000/00147576011615487c65971b3bd4acfa8ee94baaab3dbf7000
var bus = new Vue()
var vm = new Vue({
el: '#vm',
data: {
title: 'TODO List',
todos: [],
},
mounted: function() {
// bus.$on('todo', function(todo) {
// console.log(todo);
// this.todos.push(todo);
// }.bind(this))
},
created: function() {
this.init();
},
methods: {
init: function() {
this.todos = [{
name: "kavan",
description: "foo"
},
{
name: "lili",
description: "bar"
}
]
},
create: function(todo) {
const todo_new = { ...todo }
console.log(todo_new)
this.todos.push(todo_new)
},
update: function(todo, prop, event) {
todo[prop] = event.target.innerText
}
}
});
var vmAdd = new Vue({
el: '#vmAdd',
data: {
name: '',
description: ''
},
methods: {
submit: function() {
console.log(vm)
vm.create(this.$data)
this.name = '';
this.description = '';
}
}
});
</script>
</body>
</html>
先吐槽一下你的代碼,為什么要用兩個(gè) vue 實(shí)例……,其實(shí)用一個(gè)更簡潔一點(diǎn)。
然后是你上面的問題
我的改動(dòng)是這個(gè)地方
create: function(todo) {
const todo_new = { ...todo } // 復(fù)制值
console.log(todo_new)
this.todos.push(todo_new)
},
這里其實(shí)是一個(gè) js 基礎(chǔ)問題,關(guān)于對(duì)象的引用,其實(shí)是引用的對(duì)象的一個(gè)指針。例如下面
var obj = { name: 'lw' }
var obj_new = obj
// 這里 obj 和 obj_new 他們都保存的是指向同一個(gè)對(duì)象的一個(gè)指針,而不是對(duì)象的值
// 例如下面這樣
obj_new.name = 'xm'
// 你會(huì)發(fā)現(xiàn) obj.name 的值也會(huì)變?yōu)?xm 而不是原來的 lw
然后你的問題就明了了,你傳遞給 vm 的對(duì)象,把 vmAdd 對(duì)值的跟蹤處理(get,set)也一起傳入。這樣的話,其實(shí)你傳入的這個(gè)值和 vmAdd 中的 data 指向的對(duì)象是同一個(gè)。
所以解決方法就是把這個(gè)對(duì)象深度復(fù)制一下,然后傳入對(duì)象的值而不是傳入對(duì)象的一個(gè)引用。
login()
里面的.then(res =>res.data)
去掉
設(shè)置cookie的path為/
初始化確實(shí)就是改變一下背景,如果想其中某個(gè)特定的字符或者代碼塊要高亮的話是需要配置的,你去查看它的使用文檔就知道了!
北大青鳥APTECH成立于1999年。依托北京大學(xué)優(yōu)質(zhì)雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國IT技能型緊缺人才,是大數(shù)據(jù)專業(yè)的國家
北大青鳥中博軟件學(xué)院創(chuàng)立于2003年,作為華東區(qū)著名互聯(lián)網(wǎng)學(xué)院和江蘇省首批服務(wù)外包人才培訓(xùn)基地,中博成功培育了近30000名軟件工程師走向高薪崗位,合作企業(yè)超4
中公教育集團(tuán)創(chuàng)建于1999年,經(jīng)過二十年潛心發(fā)展,已由一家北大畢業(yè)生自主創(chuàng)業(yè)的信息技術(shù)與教育服務(wù)機(jī)構(gòu),發(fā)展為教育服務(wù)業(yè)的綜合性企業(yè)集團(tuán),成為集合面授教學(xué)培訓(xùn)、網(wǎng)
達(dá)內(nèi)教育集團(tuán)成立于2002年,是一家由留學(xué)海歸創(chuàng)辦的高端職業(yè)教育培訓(xùn)機(jī)構(gòu),是中國一站式人才培養(yǎng)平臺(tái)、一站式人才輸送平臺(tái)。2014年4月3日在美國成功上市,融資1
曾工作于聯(lián)想擔(dān)任系統(tǒng)開發(fā)工程師,曾在博彥科技股份有限公司擔(dān)任項(xiàng)目經(jīng)理從事移動(dòng)互聯(lián)網(wǎng)管理及研發(fā)工作,曾創(chuàng)辦藍(lán)懿科技有限責(zé)任公司從事總經(jīng)理職務(wù)負(fù)責(zé)iOS教學(xué)及管理工作。
浪潮集團(tuán)項(xiàng)目經(jīng)理。精通Java與.NET 技術(shù), 熟練的跨平臺(tái)面向?qū)ο箝_發(fā)經(jīng)驗(yàn),技術(shù)功底深厚。 授課風(fēng)格 授課風(fēng)格清新自然、條理清晰、主次分明、重點(diǎn)難點(diǎn)突出、引人入勝。
精通HTML5和CSS3;Javascript及主流js庫,具有快速界面開發(fā)的能力,對(duì)瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網(wǎng)頁制作和網(wǎng)頁游戲開發(fā)。
具有10 年的Java 企業(yè)應(yīng)用開發(fā)經(jīng)驗(yàn)。曾經(jīng)歷任德國Software AG 技術(shù)顧問,美國Dachieve 系統(tǒng)架構(gòu)師,美國AngelEngineers Inc. 系統(tǒng)架構(gòu)師。