LoginSignup
0
0

More than 1 year has passed since last update.

フロント コーディングメモ

Last updated at Posted at 2023-01-04

v-onで便利な機能

v-on:prevent

v-onだけだとページのリロードが発生してしまうが、preventでサブミットだけキャンセルできるあ。

vue
<p v-on:click="onPClickEvent('green', $event)" v-bind:style="{backgroundColor: pBgColorEvent}">{{pMsg2}}</p>
typescript
const msg = ref("未送信")
const onFormSubmit = (): void => {
  msg.value = "送信されました"
}

リンク

Javascriptで用意されている主なイベント

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0