uni-app 选择图片(chooseImage)

摘要:
uni-app选择图片(chooseImage)123button4info56789exportdefault{10data(){11retur
uni-app 选择图片(chooseImage)
1 <template>
2     <view>
3         <button type="primary"@click="img">button</button>
4         <button type="primary"@tap="info">info</button>
5     </view>
6 </template>
7 
8 <script>
9 export default{
10 data() {
11             return{
12                 
13 }
14 },
15 methods: {
16             //img:function(){
17             //uni.chooseImage({
18             //// count:  允许上传的照片数量
19             //count:5,
20             //// sizeType:  original 原图,compressed 压缩图,默认二者都有
21             //sizeType: "original",
22             //success: function(res){
23             //console.log(res)
24             //} 
25             //});
26             //},
27 img(){
28 uni.chooseImage({
29                     //count:  允许上传的照片数量
30 count:5,
31                     //sizeType:  original 原图,compressed 压缩图,默认二者都有
32 sizeType: "original",
33 success(res){
34 console.log(res)
35 uni.previewImage({
36                             //对选中的图片进行预览
37 urls: res.tempFilePaths,
38                             //urls:['','']  图片的地址 是数组形式
39 })
40 } 
41 });
42 },
43 info(){
44 uni.getImageInfo({
45 src:'http://tmp/touristappid..4zDrukCye8Nz43bf15211b0e1e455089ee0b03dac6b7.png',
46 success(res){
47 console.log(res)
48 }
49 })
50 }
51             //info:function(){
52             //uni.getImageInfo({
53             //src:'http://static.hcoder.net/public/images/logo.png',
54             //success: function(res){
55             //console.log(res)
56             //}
57             //})
58             //}
59 }
60 }
61 </script>
62 
63 <style>
64 
65 </style>

最近看的感觉除了把代码复制上来没啥别的操作,也没啥效果图

免责声明:文章转载自《uni-app 选择图片(chooseImage)》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇Zotero使用教程(2)-数据备份《学习之道》下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

安卓ImageButton圆角按钮设置

首先图片要做成圆角的,使用美图秀秀,这个不多说。 之后使用设置了圆角的按钮,效果有缺陷,按钮会有灰色的边角。 类似这样: 去掉的方法是将layout的  android:src="http://t.zoukankan.com/@drawable/xx" 改为  android:background="@drawable/xx" 达成效果:...

flask 单个表单多个提交按钮 --

单个表单多个提交按钮 在某些情况下,可能需要为一个表单添加多个提交按钮。比如在创建文章的表单中添加发布按钮和存草稿的按钮。当用户提交表单时,需要在视图函数中根据按下的按钮来做出不同的处理。 下面例子中创建了一个表单,save按钮用于保存,publish表示发布,正文字段使用TextAreaField字段。 forms.py: classNewPostFor...

python tkinter 学生信息管理系统

使用tkinter模块,python3.6,主要功能有添加,查询,删除,修改学生信息 使用模版: 1 from tkinter import * 2 import tkinter.font as tkFont 3 import tkinter as tk 4 from tkinter import ttk 最主要也是最难做的是,实现不同功能的界面在同一TK...

window.open()不同源页面通信

父页面 运行端口:8080 <template> <div> <el-button @click="open()">发送消息给子页面</el-button> </div> </template> <script> export default{ na...

Android学习笔记之 SimpleAdapter 中添加按钮响应事件,getView的重写

Andriod 里面的ListView是一个显示列表数据的控件,常用适配器SimpleAdapter进行绑定,绑定代码如下: ListView lstView = (ListView) this.findViewById(R.id.listView1); SimpleAdapter adapter=new SimpleAdapter(context, d...

Qt QSS QCheckBox和QRadioButton

导读      单选按钮(QRadioButton)和复选框(QCheckBox)是界面设计中的重要元素。单选按钮只允许用户在一组选项中选择一个,且当其中一个被选中的时候,按钮组中的其他单选按钮自动取消。复选框则可以让用户同时选中多个选项,这在多项选择的情况下非常有用。此外,复选框经过设置还具备第三种状态:未决状态(partially checked)。单...