计时器setTimeout()方法的用法,怎样改变成1 foo

news/2024/7/9 23:47:57 标签: vue
<template>
  <title>陈尼克</title>
  <div>
     {{ count }} {{ object.foo }}
  </div>
</template>

<script>
//import { defineProps, reactive } from 'vue'

//import { createApp, ref, reactive } from 'vue';
import { ref, reactive } from 'vue';
//const { createApp, ref, reactive } = Vue;
//const App = {
  export default {
  setup() {
    const count = ref(0)
    const object = reactive({
      foo: "bar",
    });

    setTimeout(() => {
      count.value = 1,
      object.foo = "foo";
    },2000);


    return {
      count,
      object,
    };
  },
};
</script>
<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>


setTimeout(() => {
    canshu1
    canshu2: ""
    },2000);



http://www.niftyadmin.cn/n/957720.html

相关文章

keras预测函数采坑实录

使用两种方法构建模型&#xff0c;一种是如下所示方法&#xff0c;构建一个VGG16网络&#xff1a; model Sequential()model.add(Conv2D(32, (3, 3), strides(1, 1), input_shape(299, 299, 3), paddingsame, activationrelu,kernel_initializeruniform))model.add(Conv2D(32,…

如何获取用户的微信openid

如何获取用户的微信openid 如何获取用户的微信openid &#xff08;1&#xff09;首先登陆微信公众号后台&#xff08;确保你有登陆微信后台的权限才可以哦&#xff09;&#xff08;2&#xff09;登陆后点击左侧“用户管理”&#xff0c;然后找到你要查的用户&#xff0c;右击头…

keras yolov3 Could not create cudnn handle: CUDNN_STATUS_ALLOC_FAILED

训练、测试Tensorflow、Keras代码时&#xff0c;出现could not create cudnn handle: CUDNN_STATUS_NOT_INITIALIZED、error retrieving driver version: Unimplemented: kernel reported driver version not implemented on Windows、could not destroy cudnn handle: CUDNN_S…

java实现微信公众号的模板消息推送

java实现微信公众号的 文章目录 前言 一、什么是模板消息 二、获取模板ID 三、获取access_token 四、发送消息 五、完整的代码 总结 前言 最近做项目时需要用到公众号的模板消息&#xff0c;所以在这里记录分享一下实现过程 一、什么是模板消息 ↓↓↓↓ 官方文档 微信公众号…

如果h忘记写再import里了,就显示不出来,说h没有被定义

<template><title>陈尼克</title><div>{{ count }} {{ object.foo }}</div> </template><script> //import { defineProps, reactive } from vue//import { createApp, ref, reactive } from vue; import { ref, reactive, h } from…

SPRINGBOOT返回数据NULL参数设为空字符串或空数组

SPRINGBOOT返回数据NULL参数设为空字符串或空数组 package com.ruoyi.framework.config.ResponseVoConfig.WebConfig;/*** Classname MyJsonMapper* Description TODO* Date 2022/1/20 0020 上午 10:39* Created by jcc*/ import com.fasterxml.jackson.core.JsonGenerator; im…

windows10+keras下的yolov3的快速使用及自己数据集的训练

引用&#xff1a; https://blog.csdn.net/u012746060/article/details/81183006#commentsedit 由于这篇大牛的文章有一点小问题&#xff0c;所以把其中的小问题修正之后&#xff0c;自己发布一篇&#xff0c;一下为正文&#xff1a; 一、环境要求 tensorflow-gpu keras pych…

MATLAB批量读取一个文件夹下的图片

转载自&#xff1a; https://blog.csdn.net/yaqin1112/article/details/80051772 file_path D:\mormal_dibright\;% 图像文件夹路径 img_path_list dir(strcat(file_path,*.bmp));%获取该文件夹中所有bmp格式的图像 img_num length(img_path_list);%获取图像总数量 …