Import properties from an object

前端 未结 2 1546
情深已故
情深已故 2021-01-14 00:50

I am trying to import a single function from a functions file. The functions file looks like this.

const Functions = {
    url(path = \'\') {
        path =          


        
2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-14 01:30

    If you use 'default export' then the import should be:

    import Functions from "../Utils/Functions";
    

    Actually, you can import it with any identifier you like (not only 'Functions')

提交回复
热议问题