国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

vue3+element-plus 表單輸入框無法輸入

這篇具有很好參考價值的文章主要介紹了vue3+element-plus 表單輸入框無法輸入。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點(diǎn)擊"舉報違法"按鈕提交疑問。

Element-Plus在進(jìn)行reactive在對登錄用戶密碼輸入輸入時失效,最后發(fā)現(xiàn)是<el-form>,在進(jìn)行ref和model進(jìn)行綁定的時候,綁定的屬性名稱都是一致的,導(dǎo)致界面無法輸入,如下圖所示都綁定的是:loginForm,代碼入下圖所示:

<template>
  <el-form
    :model="loginForm"
    ref="loginForm"
    label-position="left"
    label-width="0px"
    class="demo-ruleForm login-container"
  >
    <span class="tool-bar"> </span>
    <h2 class="title" style="padding-left: 22px">系統(tǒng)登錄</h2>
    <el-form-item prop="account">
      <el-input
        type="text"
        v-model="loginForm.account"
        auto-complete="off"
        placeholder="賬號"
      ></el-input>
    </el-form-item>
    <el-form-item prop="password">
      <el-input
        type="password"
        v-model="loginForm.password"
        auto-complete="off"
        placeholder="密碼"
      ></el-input>
    </el-form-item>
    <!-- <el-form-item>
          <el-col :span="12">
            <el-form-item prop="captcha">
              <el-input
                type="test"
                v-model="loginForm.captcha"
                auto-complete="off"
                placeholder="驗(yàn)證碼, 單擊圖片刷新"
                style="width: 100%"
              >
              </el-input>
            </el-form-item>
          </el-col>
          <el-col class="line" :span="1">&nbsp;</el-col>
          <el-col :span="11">
            <el-form-item>
              <img
                style="width: 100%"
                class="pointer"
                :src="loginForm.src"
                @click="refreshCaptcha"
              />
            </el-form-item>
          </el-col>
        </el-form-item> -->
    <el-form-item style="width: 100%">
      <el-button type="primary" style="width: 48%" @click="reset"
        >重 置</el-button
      >
      <el-button
        type="primary"
        style="width: 48%"
        @click="dologin"
        :loading="loading"
        >登 錄</el-button
      >
    </el-form-item>
  </el-form>
</template>
<script setup>
import { reactive,ref } from "vue";
import { Login } from "../../../apis/login/login.js";

// 用戶登錄信息
let loading=false;
const test=ref("");
const loginForm =reactive({
  account: "",
  password: "",
});
//重置
function reset() {
  loginForm.account = "";
  loginForm.password = "";
  return "";
}
function dologin(loginForm) {
  let data = Login(loginForm);
  console.log(data);
  return data;
}
</script>
<style  scoped>
/* .myform {
  width: 200px;
  height: 180px;
  text-align: center;
  margin-right: 20px;
  background-color: #050;
} */
.login-container {
    -webkit-border-radius: 5px;
    border-radius: 5px;
    -moz-border-radius: 5px;
    background-clip: padding-box;
    margin: 100px auto;
    width: 350px;
    padding: 35px 35px 15px 35px;
    background: #fff;
    border: 1px solid #eaeaea;
    /* box-shadow: 0 0 25px #cac6c6;
    .title {
      margin: 0px auto 30px auto;
      text-align: center;
      color: #505458;
    } */
  }
</style>

此時界面操作輸入框,是無法編輯的:

vue3+element-plus 表單輸入框無法輸入

而<el-form>修改的model="loginForm",ref="loginForm",確保兩個引用名稱不一致,否則會導(dǎo)致界面無法預(yù)覽,界面輸入框操作恢復(fù)正常,修改后的代碼截圖如下:?文章來源地址http://www.zghlxwxcb.cn/news/detail-508541.html

<template>
  <el-form
    :model="loginForm"
    ref="loginForm"
    label-position="left"
    label-width="0px"
    class="demo-ruleForm login-container"
  >
    <span class="tool-bar"> </span>
    <h2 class="title" style="padding-left: 22px">系統(tǒng)登錄</h2>
    <el-form-item prop="account">
      <el-input
        type="text"
        v-model="loginForm.account"
        auto-complete="off"
        placeholder="賬號"
      ></el-input>
    </el-form-item>
    <el-form-item prop="password">
      <el-input
        type="password"
        v-model="loginForm.password"
        auto-complete="off"
        placeholder="密碼"
      ></el-input>
    </el-form-item>
    <!-- <el-form-item>
          <el-col :span="12">
            <el-form-item prop="captcha">
              <el-input
                type="test"
                v-model="loginForm.captcha"
                auto-complete="off"
                placeholder="驗(yàn)證碼, 單擊圖片刷新"
                style="width: 100%"
              >
              </el-input>
            </el-form-item>
          </el-col>
          <el-col class="line" :span="1">&nbsp;</el-col>
          <el-col :span="11">
            <el-form-item>
              <img
                style="width: 100%"
                class="pointer"
                :src="loginForm.src"
                @click="refreshCaptcha"
              />
            </el-form-item>
          </el-col>
        </el-form-item> -->
    <el-form-item style="width: 100%">
      <el-button type="primary" style="width: 48%" @click="reset"
        >重 置</el-button
      >
      <el-button
        type="primary"
        style="width: 48%"
        @click="dologin"
        :loading="loading"
        >登 錄</el-button
      >
    </el-form-item>
  </el-form>
</template>
<script setup>
import { reactive,ref } from "vue";
import { Login } from "../../../apis/login/login.js";

// 用戶登錄信息
let loading=false;
const test=ref("");
const loginForm =reactive({
  account: "",
  password: "",
});
//重置
function reset() {
  loginForm.account = "";
  loginForm.password = "";
  return "";
}
function dologin(loginForm) {
  let data = Login(loginForm);
  console.log(data);
  return data;
}
</script>
<style  scoped>
/* .myform {
  width: 200px;
  height: 180px;
  text-align: center;
  margin-right: 20px;
  background-color: #050;
} */
.login-container {
    -webkit-border-radius: 5px;
    border-radius: 5px;
    -moz-border-radius: 5px;
    background-clip: padding-box;
    margin: 100px auto;
    width: 350px;
    padding: 35px 35px 15px 35px;
    background: #fff;
    border: 1px solid #eaeaea;
    /* box-shadow: 0 0 25px #cac6c6;
    .title {
      margin: 0px auto 30px auto;
      text-align: center;
      color: #505458;
    } */
  }
</style>

到了這里,關(guān)于vue3+element-plus 表單輸入框無法輸入的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請點(diǎn)擊違法舉報進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • Vue3 + TS + Element-Plus —— 項(xiàng)目系統(tǒng)中封裝表格+搜索表單 十分鐘寫五個UI不在是問題

    Vue3 + TS + Element-Plus —— 項(xiàng)目系統(tǒng)中封裝表格+搜索表單 十分鐘寫五個UI不在是問題

    前期回顧 純前端 —— 200行JS代碼、實(shí)現(xiàn)導(dǎo)出Excel、支持DIY樣式,縱橫合并-CSDN博客 https://blog.csdn.net/m0_57904695/article/details/135537511?spm=1001.2014.3001.5501 目錄 一、?????newTable.vue 封裝Table 二、?? newForm.vue 封裝搜索表單? 三、?? TS類型?srctypesglobal.d.ts 四、?? 頁面使用功能

    2024年01月24日
    瀏覽(25)
  • vue3使用element-plus

    vue3使用element-plus

    element-ui 是配合 vue2 使用,element-plus 是配置 vue3 使用的 1. 包管理器的方式 如果是使用?webpack 或者 vite 打包工具新建的項(xiàng)目 2. 瀏覽器直接導(dǎo)入 直接通過瀏覽器的 HTML 標(biāo)簽導(dǎo)入 Element Plus,然后就可以使用全局變量 ElementPlus 1. 導(dǎo)入全部組件且注冊所有的圖標(biāo) 聲明使用 ElementPl

    2024年02月08日
    瀏覽(35)
  • Vue3導(dǎo)入Element-plus方法

    Vue3導(dǎo)入Element-plus方法

    先引入依賴 main.js中要引入兩個依賴 然后 這個東西 我們最好還是掛載vue上 所以 還是 然后 我們可以在組件上試一下用一個ElementUi的表格組件 參考代碼如下 運(yùn)行結(jié)果如下 也是沒有任何問題

    2024年02月06日
    瀏覽(97)
  • vue3 element-plus 實(shí)現(xiàn)圖片預(yù)覽

    vue3 element-plus 實(shí)現(xiàn)圖片預(yù)覽

    element-plus下有這么一個組件 el-image-viewer /,但是這個組件是沒寫在文檔上面的,像普通組件一樣使用即可 可以通過點(diǎn)擊按鈕實(shí)現(xiàn)圖片預(yù)覽,而非el-image組件只能通過點(diǎn)擊圖片實(shí)現(xiàn)預(yù)覽 2.1封裝組件 2.3組件使用 在需要使用的地方引入,然后使用即可,這不是重點(diǎn),每個人使用的

    2024年02月15日
    瀏覽(28)
  • Vue3 封裝 element-plus 圖標(biāo)選擇器

    Vue3 封裝 element-plus 圖標(biāo)選擇器

    效果一: 效果二: ? 效果一的這個是把全部的icon圖標(biāo)都讓它顯示出來,讓我們自己選擇說選圖標(biāo) 2.1. 全局注冊 icon 組件 2.2. 組件實(shí)現(xiàn)? 2.3. 使用? 效果二的這個是渲染后端返回的icon圖標(biāo) 3.1. 全局注冊 icon 組件 3.2. 組件實(shí)現(xiàn)? 3.3. 使用?

    2024年02月07日
    瀏覽(239)
  • vue3+element-plus上傳文件,預(yù)覽文件

    vue3+element-plus上傳文件,預(yù)覽文件

    vue3+ts+element-plus上傳文件,預(yù)覽文件 場景:使用element-plus的el-upload標(biāo)簽,手動上傳文件,可預(yù)覽docx,xlsx,pdf,jpg,jpeg,png(本地資源以及網(wǎng)絡(luò)資源)。 1、使用el-upload標(biāo)簽 檢查上傳文件的文件格式與大小 上傳的附件信息在fileList中,組裝接口所需數(shù)據(jù)進(jìn)行上傳 使用docx-preview插件預(yù)覽

    2024年02月11日
    瀏覽(37)
  • vue3項(xiàng)目搭建并配置element-plus

    安裝完成后,輸入如下指令查看vue的版本: 選擇一個要存放項(xiàng)目的目錄,打開小黑窗輸入如下命令: 一開始輸入項(xiàng)目名稱或者默認(rèn)vue-project,然后根據(jù)需求選擇Yes/No 生成完項(xiàng)目后,輸入如下指令: src/main.js里引入 index.css的文件位置根據(jù)實(shí)際情況寫,也有可能是 const app后面加

    2024年02月13日
    瀏覽(30)
  • Vue3+element-plus實(shí)現(xiàn)后臺管理系統(tǒng)

    Vue3+element-plus實(shí)現(xiàn)后臺管理系統(tǒng)

    ?環(huán)境:node.js軟件 、Vs code、vite、elemnt-plus、windicss(樣式框架) ? ? 1、首先,使用npm 命令構(gòu)建項(xiàng)目( vscode安裝的插件 vscode中文顯示插件 ? 2、高亮提示插件volar ? 3、vue 3 sni 代碼提示) 快速上手 | Vue.js ? ?a. npm -v 查看node.js 版本 ? ?b. ?npm ?config get registry ? 查看注冊鏡像是

    2024年02月09日
    瀏覽(33)
  • (二) Vue3 + Element-Plus 實(shí)現(xiàn)動態(tài)菜單欄

    (二) Vue3 + Element-Plus 實(shí)現(xiàn)動態(tài)菜單欄

    系列介紹:Vue3 + Vite + TS 從零開始學(xué)習(xí) 項(xiàng)目搭建:(一) Vue3 + Vite + TS 項(xiàng)目搭建 實(shí)現(xiàn)動態(tài)菜單欄:(二) Vue3 + Element-Plus 實(shí)現(xiàn)動態(tài)菜單欄 實(shí)現(xiàn)動態(tài)面包屑:(三) Vue3 + Element-Plus 實(shí)現(xiàn)動態(tài)面包屑 實(shí)現(xiàn)動態(tài)標(biāo)簽頁:(四) Vue3 + Element-Plus 實(shí)現(xiàn)動態(tài)標(biāo)簽頁 實(shí)現(xiàn)動態(tài)主題色切換(demo):(五)

    2023年04月23日
    瀏覽(59)
  • vue3 element-plus動態(tài)菜單及動態(tài)圖標(biāo)

    引入element-plus 注冊圖標(biāo)組件 動態(tài)引入圖標(biāo)代碼 完整代碼 路由如下

    2024年01月18日
    瀏覽(50)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包