uni——input prompt (placeholder) to modify the style, etc.

Case Description

Hints for manipulating input

case code

<template>
	<view>
		<view>
			<input type="text" placeholder="请输入内容" :placeholder-class="isDialogHidden?'redColor':''" />
			<button @click="hideDialog">按钮</button>
		</view>
	</view>
</template>

<script>
export default {
      
      
	data() {
      
      
		return {
      
      
			isDialogHidden: false
		};
	},
	methods: {
      
      
		hideDialog() {
      
      
			this.isDialogHidden = true;
		}
	}
};
</script>
<style lang="scss">
.redColor {
      
      
	color: #ff0000;
}
</style>

The default is gray. When the button is clicked, the default gray prompt will turn red. placeholder-classThe attribute value is the class name. placeholder-styleor by processing

insert image description here

Guess you like

Origin blog.csdn.net/xulihua_75/article/details/132665911