iview render bug

https://codepen.io/xgqfrms/pen/gyGjKP

https://codepen.io/xgqfrms/full/gyGjKP

bug


<!DOCTYPE html>
<html lang="zh-Hans">
<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">
<meta name="author" content="xgqfrms">
<meta name="generator" content="VS code">
<title>vue & iview</title>
<!-- libs -->
<link rel="stylesheet" type="text/css" href="http://unpkg.com/iview/dist/styles/iview.css">
<script type="text/javascript" src="http://vuejs.org/js/vue.min.js"></script>
<script type="text/javascript" src="http://unpkg.com/iview/dist/iview.min.js"></script>
<!-- css -->
<style lang="css">
.audit-common-lable{
width: 120px;
display: inline-block;
text-align: left;
margin: 5px;
}
.audit-common-lable-long{
width: 60px;
display: inline-block;
text-align: right;
}
.audit-common-lable::after,
.audit-common-lable-long::after{
display: inline-block;
content: ":";
width: 0;
border: 1px;
margin: 2px;
}
</style>
</head>
<body>
<section>
<div id="app">
<template>
<i-row>
<i-col span="24" push="1" style="margin: 5px;">
<span class="audit-common-lable-long">请求方式</span>
<i-switch
style="width: 57px"
size="large"
@on-change="onSwitchChange"
v-model="isGet">
<span slot="open">GET</span>
<span slot="close">POST</span>
</i-switch>
</i-col>
</i-row>
</template>
<template>
<i-row>
<i-col span="24" push="1" style="margin: 5px;">
<span class="audit-common-lable-long">URL</span>
<i-input
v-model="url"
placeholder="请输入 URL!"
style="width: 300px"
prefix="md-link"
/>
</i-col>
</i-row>
</template>
<template>
<i-row>
<i-col span="24" push="1" style="margin: 5px;">
<span class="audit-common-lable-long">授权方式</span>
<i-select
aria-placeholder="授权方式"
placeholder="请选择授权方式"
style="width: 200px"
v-model="authorization"
@on-change="onChangeSelect(`authorization`)"
:filterable="false"
:clearable="false">
<i-option
v-for="(item, i) in authorizations"
:value="item.value"
:key="i">
{{item.title}}
</i-option>
</i-select>
</i-col>
</i-row>
</template>
<template>
<i-row v-if="authorization==='auth'">
<i-col span="24" push="1" style="margin: 5px;">
<span class="audit-common-lable-long">Username</span>
<i-input
v-model="url"
placeholder="请输入 Username!"
style="width: 300px"
prefix="md-contact"
/>
</i-col>
<i-col span="24" push="1" style="margin: 5px;">
<span class="audit-common-lable-long">Password</span>
<i-input
v-model="url"
placeholder="请输入 Password!"
style="width: 300px"
prefix="md-lock"
/>
</i-col>
</i-row>
</template>
<template>
<i-row v-if="authorization==='token'">
<i-col span="24" push="1" style="margin: 5px;">
<span class="audit-common-lable-long">Token</span>
<i-input
v-model="url"
placeholder="请输入 Token!"
style="width: 300px"
prefix="md-lock"
/>
</i-col>
</i-row>
</template>
<template v-if="isGet">
<i-row>
<i-col span="18" push="1" style="margin: 5px;">
<span class="audit-common-lable">GET 参数列表</span>
<i-button
@click="addGetParams"
size="small">
+ 添加
</i-button>
<!-- :maxHeight="maxGetHeight" -->
<i-table
style="margin: 5px; max-height: 300px; overflow-y: auto;"
:columns="colsGET"
:data="dataGET">
</i-table>
</i-col>
</i-row>
</template>
<template v-else>
<i-row>
<i-col span="23" push="1" style="margin: 5px;">
<span class="audit-common-lable">POST 参数方式</span>
<i-switch
style="width: 57px"
size="large"
@on-change="onSwitchRadioChange"
v-model="isJSON">
<span slot="open">form data</span>
<span slot="close">JSON</span>
</i-switch>
</i-col>
<i-col span="23" push="1" style="margin: 5px;" v-if="isJSON">
<span class="audit-common-lable">参数类型(form data)</span>
<i-table
style="margin: 5px;"
:columns="colsPOST"
:data="dataPOST">
</i-table>
</i-col>
<i-col span="6" push="1" style="margin: 5px;" v-else>
<span class="audit-common-lable">参数类型(JSON)</span>
<i-input
style="margin: 5px; width: 500px;"
placeholder="请输入 JSON String"
v-model="jsonString"
:rows="8"
type="textarea">
</i-input>
</i-col>
</i-row>
</template>
<template>
<i-row>
<i-col span="24" push="1" style="margin: 5px;"></i-col>
<i-col span="2" push="1" style="margin: 5px;">
<i-button
@click="showSave"
size="small"
type="warning">
保存
</i-button>
</i-col>
<i-col span="2" push="0" style="margin: 5px;">
<i-button
:disabled="!isSaved"
@click="showExecute "
size="small"
type="primary">
执行
</i-button>
</i-col>
</i-row>
<Modal
v-model="saveModal.visible"
title="确定保存">
<span></span>
<div slot="footer">
<i-button
type="error"
size="large"
:loading="saveModal.loading"
@click="cancelSave">
取消
</i-button>
<i-button
type="success"
size="large"
:loading="saveModal.loading"
@click="resureSave">
确定
</i-button>
</div>
</Modal>
<Modal
v-model="executeModal.visible"
@on-ok="resureExecute"
@on-cancel="cancelExecute"
title="确定执行">
<!-- 确定执行 -->
</Modal>
</template>
</div>
</section>
<!-- js -->
<script>
new Vue({
el: "#app",
data: {
saveModal: {
visible: false,
loading: false,
},
executeModal: {
visible: false,
loading: false,
},
isGet: true,
colsGET: [
{
title: "key",
key: "keyword",
},
{
title: "value",
key: "value",
},
{
title: "desc",
key: "description",
render: (h, params) => {
let {
isEdit,
description: desc,
} = params.row;
if (isEdit) {
return h("div", [
h("input", {
attrs: {
value: desc,
placeholder: "请输入描述信息",
}
}, ""),
]);
} else {
return h("div", [
h("span", desc),
]);
}
}
},
{
title: "操作",
key: "operate",
render: (h, params) => {
let that = this;
let isEdit = params.row.isEdit;
let edit = params.row.operate[0];
let save = params.row.operate[1];
if (isEdit) {
return h("div", [
h("Icon", {
props: {
name: "person"
}
}),
h("a", {
on: {
click: () => {
console.log(`row =\n`, JSON.stringify(params.row, null, 4),);
that.clickSave(params.row.index);
},
},
}, save),
]);
} else {
return h("div", [
h("a", {
on: {
click: () => {
console.log(`编辑 row =\n`, JSON.stringify(params.row, null, 4), params.row.index);
that.clickEdit(params.row.index);
},
// click: that.clickEdit(params.row.index),
},
}, edit),
]);
}
},
},
],
dataGET: [
{
index: 0,
keyword: "a",
value: "1",
description: "a=1",
operate: ["edit", "save", "cancel"],
isEdit: true,
// isEdit: false,
},
{
index: 1,
keyword: "b",
value: "2",
description: "b=1",
operate: ["edit", "save", "cancel"],
isEdit: false,
},
],
colsPOST: [],
dataPOST: [],
authorizations: [
{
title: "No Auth",
value: "no",
},
{
title: "Basic Auth",
value: "auth",
},
{
title: "Bearer Token",
value: "token",
},
],
url: "",
authorization: "no",
isJSON: true,
postType: "form",
jsonString: "",
isSaved: false,
maxGetHeight: 300,
},
methods: {
addGetParams() {
this.dataGET.push({
keyword: "a",
value: "1",
description: "a=1",
operate: ["edit", "save", "cancel"],
});
},
showSave() {
this.saveModal.visible = true;
},
showExecute() {
this.executeModal.visible = true;
},
resureSave() {
this.saveModal.visible = false;
this.isSaved = true;
},
cancelSave() {
this.saveModal.visible = false;
this.isSaved = false;
},
resureExecute() {
this.executeModal.visible = false;
},
cancelExecute() {
this.executeModal.visible = false;
},
onSwitchChange() {
// this.isGet = !this.isGet;
console.log(`value =`, this.isGet);
},
onSwitchRadioChange() {
let value = this.isJSON;
console.log(`isJSON value =`, value);
if (value) {
this.postType = "json";
} else {
this.postType = "form";
}
console.log(`postType = `, this.postType);
},
onChangeSelect (type = ``) {
let value = this[type];
// this.$Message.info(value);
},
onChangeRadio (type = ``) {
let value = this[type];
this.$Message.info(value);
},
onChangeRadioGroup (type = ``) {
let value = this[type];
this.$Message.info(value);
},
clickSave(index = ``) {
if (index !== ``) {
console.log(`table index =`, index);
this.dataGET[index].isEdit = true;
}
},
clickEdit(index = ``) {
if (index !== ``) {
console.log(`table index =`, index);
this.dataGET[index].isEdit = true;
}
},
},
mounted() {
//
},
})
</script>
</body>
</html>

vue namespace bug

vue & TypeError: is not a function

https://stackoverflow.com/questions/49950029/vue-uncaught-typeerror-fn-bind-is-not-a-function

iview render bug & vue namespace bug的更多相关文章

  1. vue h render function & render select with options bug

    vue h render function & render select with options bug https://github.com/xgqfrms/vue/issues/41 ...

  2. vue & less bug

    vue & less bug bezierEasingMixin(); ^ Inline JavaScript is not enabled. Is it set in your option ...

  3. vue bug & data type bug

    vue bug & data type bug [Vue warn]: Invalid prop: type check failed for prop "value". ...

  4. js & 快捷键 & vue bind bug

    js & 快捷键 & vue bind bug how to prevent addEventListener bind many times solution dataset &am ...

  5. 【iview input 回车刷页面bug】input 就一个的时候 有form的时候 回车会刷页面,如果就一个input,可以不要form,或者form里面两个input 将一个input v-show false 就可以了

    [iview input 回车刷页面bug]input 就一个的时候 有form的时候 回车会刷页面,如果就一个input,可以不要form,或者form里面两个input 将一个input v-sh ...

  6. vue iview render里面 没有双向绑定 renderHeader 要序列化 反序列 一下

    vue iview render里面 没有双向绑定 renderHeader 要序列化 反序列 一下 renderHeader: (h, params) => { return [ h('Rad ...

  7. vue-cli & plugin:vue/strongly-recommended bug

    vue-cli & plugin:vue/strongly-recommended bug ESLint plugin:vue/strongly-recommended module.expo ...

  8. vuex bug & vue computed setter

    vuex bug & vue computed setter https://vuejs.org/v2/guide/computed.html#Computed-Setter [Vue war ...

  9. puppeteer render local HTML template bug

    puppeteer render local HTML template bug ➜ url-to-poster git:(master) ✗ dev ^-v-^ app is running in ...

随机推荐

  1. 【js】把一个json对象转成想要的数组

    var arrTemp = []; var arrRes = []; var jsonObjct = { "CRM_UNIT_TYPE_A": { "dic_desc&q ...

  2. 转载 1-EasyNetQ介绍(黄亮翻译) https://www.cnblogs.com/HuangLiang/p/7105659.html

    EasyNetQ 是一个容易使用,坚固的,针对RabbitMQ的 .NET API. 假如你尽可能快的想去安装和运行RabbitMQ,请去看入门指南.EasyNetQ是为了提供一个尽可能简洁的适用与R ...

  3. rabbitMQ常用方法说明 – 6中工作模式及关键点

    首先,RabbitMQ解决什么问题? 1)信息的发送者和接收者如何维持连接,如果一方的连接中断,这期间的数据如何防止丢失? 2)如何降低发送者和接收者的耦合度? 3)如何让Priority高的接收者先 ...

  4. 启动项目显示:非法字符:'\ufeff' 和需要 class ,interface 或者 enum 错误

    原来是因为 Windows 记事本在修改 UTF-8 文件时自作聪明地在文件开头添加 BOM 导致的,所以才会导致 IDEA 不能正确读取 .java 文件从而程序出错. 解决: 找到 xxx. ja ...

  5. Recurrent Neural Network[Content]

    下面的RNN,LSTM,GRU模型图来自这里 简单的综述 1. RNN 图1.1 标准RNN模型的结构 2. BiRNN 3. LSTM 图3.1 LSTM模型的结构 4. Clockwork RNN ...

  6. Windows OpenSSH 基本用法

    笔者在前文<Windows 支持 OpenSSH 了!>中介绍了 Windows 对 OpenSSH 支持的基本内容,本文在前文的基础上介绍一些 OpenSSH Server 的配置和常见 ...

  7. 命令行创建mysql数据库指定编码方法

    GBK: create database test2 DEFAULT CHARACTER SET gbk COLLATE gbk_chinese_ci; UTF8: CREATE DATABASE t ...

  8. mysqlfrm

    mysqlfrm可基于frm文件生成对应的表结构.常用于数据恢复场景. 其有两种操作模式. 1. 创建一个临时实例来解析frm文件. 2. 使用诊断模式解析frm文件. 以下表进行测试,看看, 1.  ...

  9. 容易被忽略的label标签

    # 容易被忽略的label标签 ## 原始作用 `label`标签是HTML原生的标签,其原始的作用参考[这里](http://www.w3school.com.cn/tags/tag_label.a ...

  10. RabbitMQ 3.6.1 升级至 3.7.9 版本(Windows 升级至Centos)

    随着公司业务量的增加,原本部署在Windows服务器的RabbitMQ集群(3.6.1)总是出现莫名其妙的问题,经查询官方Issue,确认是RabbitMQ 3.6.1 版本的bug.查看从3.6.1 ...