0
点赞
收藏
分享

微信扫一扫

vue调用ts实现加减法

step1:主界面 C:\Users\Windows\WebstormProjects\untitled\src\App.vue

<template>
  <span><a @click="connectTcp()">开始长连接</a></span>
</template>

<script>
import { img2Pdf } from './components/util.ts';

export default {
  name: 'App',
  components: {
  },
  methods: {
    connectTcp() {
      console.log('开始测试')
      console.log(img2Pdf(2,3))
    },
  }
}
</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>

step2:被调用的界面 C:\Users\Windows\WebstormProjects\untitled\src\components\util.ts

export function img2Pdf(a,b) {
  return a+b;
}

end

举报

相关推荐

0 条评论