doctype html
>
<
html
lang
="en"
>
<
head
>
<
meta
charset
="utf-8"
>
<
meta
name
="viewport"
content
="width=device-width, initial-scale=1.0"
>
<
title
>登入切換
title
>
head
>
<
style
>
style
>
<
body
>
<
div
id>
<
span
v-if
="isuser"
>
<
label
for="username"
>賬號
label
>
<
input
type
="text"
id="username"
placeholder
="填寫賬號"
key="username"
>
span
>
<
span
v-else
>
<
label
for="email"
>郵箱
label
>
<
input
type
="text"
id="email"
placeholder
="填寫郵箱"
key="email"
>
span
>
<
button
@click
="isuser = !isuser"
>切換型別
button
>
div>
body
>
<
script
src="js/vue.js"
>
script
>
<
script
>
=new
vue(
})script
>
html
>
元素的復用是底層**決定的,而加上key值可以防止元素復用,以免輸入資訊在切換的時候還保留在輸入框中。
簡單的系統登入案例
本案例是使用的簡單token作為驗證 而token與使用者資訊會儲存在redis中 簡單說明一下本案例的一些邏輯,可能存在某些漏洞,希望大家指正 使用者未登入時,訪問系統中任意controller方法都將跳轉至登入頁面 使用者使用url訪問系統中任意頁面 我們是將頁面放在了web inf之外的 都將...
使用者登入切換的案例以及小問題
lang en charset utf 8 titletitle head v if isuser for username 使用者賬號label type text id username placeholder 使用者賬號 key username span v else for email 使...
PyQt5的簡單登入介面切換
這個demo中的介面切換通過pyqt5中按鍵槽函式響應介面close show 函式實現 import sys from pyqt5.qtwidgets import 登入介面類 class login qwidget def init self,parent none super login,se...