handle.js 363 B

1234567891011121314151617181920212223242526272829303132
  1. export default {
  2. computed:{
  3. input:function () {
  4. return this.$refs.input;
  5. }
  6. },
  7. emits:['change'],
  8. methods:{
  9. onChange:function () {
  10. if (this.input.value) {
  11. this.$emit('change',this.input.files);
  12. if (this.clear) {
  13. this.input.value = '';
  14. }
  15. }
  16. },
  17. /* 打开 */
  18. open:function () {
  19. return this.input.click();
  20. }
  21. }
  22. }