鍍金池/ 問答/ HTML問答
朕略萌 回答

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)
          }
        }
    });
  });
放開她 回答

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() 試試

怣人 回答

先附一段解決后的完整代碼

<!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è)引用。

獨(dú)白 回答

初始化確實(shí)就是改變一下背景,如果想其中某個(gè)特定的字符或者代碼塊要高亮的話是需要配置的,你去查看它的使用文檔就知道了!

鏈接:http://highlightjs.readthedoc...