I am trying to implement jcrop via this example. It keeps giving me an export error as well as a Devtools error delcaring it can not find the jcrop.js.map. I clicked both the dependencies in the view source and they work and I can't even find where they reference jcrop.js.map so I am unsure if something is wrong with the dependencies or in my code from the example. I put the code into a snippet for reference.
1st error: Uncaught SyntaxError: Unexpected token 'export'
2nd error: DevTools failed to load source map: Could not load content for https://unpkg.com/jcrop.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
const origin = [150,160,540,270];
export default {
data: () => ({
rect: origin.slice(0),
options: {
handles: ['sw','nw','ne','se'],
aspectRatio: origin[2]/origin[3]
},
pos: {}
}),
methods: {
getOrigin() { return origin.slice(0); },
originalCrop() { this.rect = this.getOrigin(); }
}
}
<link rel="stylesheet" href="https://unpkg.com/jcrop/dist/jcrop.css">
<script src="https://unpkg.com/jcrop"></script>
<template>
<div>
<Jcrop
src="https://d3o1694hluedf9.cloudfront.net/sierra-750.jpg"
@update="pos = $event.sel.round()"
:rect="rect"
:options="options"
/>
<coords :rect="pos"/>
<button @click="originalCrop()">Reset</button>
</div>
</template>